Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ID error

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
This is my code:
" WHERE CheckNUM = " & "'" & Request.QueryString("ID")) & "'"

I am getting an error on line 72 which is below

Response.Write(&quot;<INPUT TYPE='TEXT' NAME='ID' VALUE=&quot; & rsGlobalWeb(&quot;CheckNUM&quot;) & &quot; >&quot;)

How can this be resolved?
 
[tt]

When I pass the ID in the url and request it to display it I do this:

My passed ID is <%=request.querystring(&quot;id&quot;)%>



[tt]&quot;A Successful man is one who can build
a firm foundation with the bricks
that others throw at him&quot;
[/tt]

banana.gif
rockband.gif
banana.gif
 
Is the error anything to do with the parentheses??
Try this:

Response.Write &quot;<INPUT TYPE=&quot;&quot;TEXT&quot;&quot; NAME=&quot;&quot;ID&quot;&quot; VALUE=&quot;&quot;&quot; & rsGlobalWeb(&quot;CheckNUM&quot;) & &quot;&quot;&quot;>&quot;
Mighty :)
 
The format apears to be correct, post your error so we can see what we're dealing with. If your getting an &quot;Either BOF or EOF&quot; error than the error is only pointing to that line because it's the first time it was told to output a calue from the empty recordset. Post the code for the sql string, the query, and also the error.
-Tarwn &quot;Customer Support is an art not a service&quot; - marketing saying
&quot;So are most other forms of torture&quot; - programmers response
(The Wiz Biz - Rick Cook)
 
thanks to all.
Here is the offending code and error messages that followed:

Dim SqlStmt

Set dbGlobalWeb = Server.CreateObject(&quot;ADODB.Connection&quot;)

dbGlobalWeb.Open &quot;DSN=utrac&quot;

SqlStmt = &quot; SELECT checkNUM, name, address, city, state, zip, phone, email &quot; &_
&quot; FROM TblDemograph &quot; &_
&quot; WHERE checkNUM = &quot; & &quot;'&quot; & Request.QueryString(&quot;ID&quot;) & &quot;'&quot;

Here, checkNUM is a numeric field.

The first error says
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type varchar to numeric.


Then when I put CINT(request.querystring(&quot;ID&quot;)), then next error says
Error Type:
(0x80020009)
Exception occurred.
on line 72
 
If checkNum is a numeric field than you should not put single quotes around it in the query because it forces the server to treat it as a string, which is probably why uit is throwing the error for varchar to numeric since it as attempting to reconvert the string you gave it back to a number. Also, you need to make sure Request.QueryString(&quot;ID&quot;) is not an empty string and it is numeric before attempting to do a conversion on it.
-Tarwn &quot;Customer Support is an art not a service&quot; - marketing saying
&quot;So are most other forms of torture&quot; - programmers response
(The Wiz Biz - Rick Cook)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top