I'm trying to pull data with asp from a sql server. Everything works ok except in one feild if i type 0232332aa or any combination of letters and numbers i get an error from the webpage, then can't get back into edit the number through my webpage. I'm running IIS with SQL2k.
This is the error i get...
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'aa'.
/quarantine/new/quarantine_edit.asp, line 148
I have tried to set the datatype to char, text, numeric and nothing seems to work. If i look at my asp code i don't see an error at line 148 my code there looks like this...
if (Request.Form("saveid"
<>"" and Request.Form("action"
="edit"
then
strSQL="update " & strTableName & " set "
For i = 1 To Request.Form("FieldName"
.Count
if Request.Form("Updatable"
(i)<>"True" then _
i=i+1
strSQL=strSQL & AddWrappers(Request.Form("FieldName"
(i)) & "="
' boolean
if Request.Form("FieldType"
(i)="11" then
if Request.Form(Request.Form("FieldName"
(i))="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if (Request.Form("NeedQuotes"
(i))="True" then
strValue= "'" & Replace( Request.Form(Request.Form("FieldName"
(i)) , "'", "''"
& "'"
else
if Request.Form(Request.Form("FieldName"
(i))="" then
strValue="0"
else
strValue=Request.Form(Request.Form("FieldName"
(i))
end if
end if
end if
I don't see what is wrong, am i missing some little mistake?
Thanks for any help.
This is the error i get...
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'aa'.
/quarantine/new/quarantine_edit.asp, line 148
I have tried to set the datatype to char, text, numeric and nothing seems to work. If i look at my asp code i don't see an error at line 148 my code there looks like this...
if (Request.Form("saveid"
strSQL="update " & strTableName & " set "
For i = 1 To Request.Form("FieldName"
if Request.Form("Updatable"
i=i+1
strSQL=strSQL & AddWrappers(Request.Form("FieldName"
' boolean
if Request.Form("FieldType"
if Request.Form(Request.Form("FieldName"
strValue="1"
else
strValue="0"
end if
else ' not boolean
if (Request.Form("NeedQuotes"
strValue= "'" & Replace( Request.Form(Request.Form("FieldName"
else
if Request.Form(Request.Form("FieldName"
strValue="0"
else
strValue=Request.Form(Request.Form("FieldName"
end if
end if
end if
I don't see what is wrong, am i missing some little mistake?
Thanks for any help.