derekbaehr
01-24-2002, 06:09 PM
really strange thing. i take a field, lets say, street. i run a little function to convert the string to first letter. so, if the user types in west first street on the form, West First Street gets entered into the database.
Now the weird part. I call that field from the db, and it returns West. First Street does not show, but it shows in the database.
i am using sql server seven, and here is my code:
Function ChkString(InString)
if InString = "" then InString = " "
InString = Replace(InString, "'","''")
FoundSpace = True
OutputString = ""
for MidPosition = 1 to len(InString)
if FoundSpace = true then
OutputString = OutputString & UCase(Mid(InString,MidPosition,1))
FoundSpace = false
else
OutputString = OutputString & LCase(Mid(InString,MidPosition,1))
if Mid(InString,MidPosition,1) = " " then FoundSpace = true
if Mid(InString,MidPosition,1) = chr(10) then FoundSpace = true
end if
next
ChkString = OutputString
End Function
'gets values from form
strstreet= ChkString(Request.Form("street"))
'call from db
sql = "select Street from tblTemp where User_ID = '"& session("ID") &"'"
set objRS = server.CreateObject("ADODB.recordset")
Set objRS = connApp.Execute(sql)
strstreet=objRS("Street")
'html code
<td colspan="2"><font face="Arial, Helvetica, sans-serif" size="1">Current
Street Address<br>
<input type="text" name=street size="30" maxlength=30 value=<%=strstreet%>>
what am i doing wrong?
Now the weird part. I call that field from the db, and it returns West. First Street does not show, but it shows in the database.
i am using sql server seven, and here is my code:
Function ChkString(InString)
if InString = "" then InString = " "
InString = Replace(InString, "'","''")
FoundSpace = True
OutputString = ""
for MidPosition = 1 to len(InString)
if FoundSpace = true then
OutputString = OutputString & UCase(Mid(InString,MidPosition,1))
FoundSpace = false
else
OutputString = OutputString & LCase(Mid(InString,MidPosition,1))
if Mid(InString,MidPosition,1) = " " then FoundSpace = true
if Mid(InString,MidPosition,1) = chr(10) then FoundSpace = true
end if
next
ChkString = OutputString
End Function
'gets values from form
strstreet= ChkString(Request.Form("street"))
'call from db
sql = "select Street from tblTemp where User_ID = '"& session("ID") &"'"
set objRS = server.CreateObject("ADODB.recordset")
Set objRS = connApp.Execute(sql)
strstreet=objRS("Street")
'html code
<td colspan="2"><font face="Arial, Helvetica, sans-serif" size="1">Current
Street Address<br>
<input type="text" name=street size="30" maxlength=30 value=<%=strstreet%>>
what am i doing wrong?