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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT MAX(ID) problem

Status
Not open for further replies.

LongFeiFengWu

Technical User
Nov 9, 2001
98
US
I'm trying to select the MAX(ID) of a table for a specific user. The code I'm using is:

<%

VZID1 = request.cookies("ECT")("VZID")

SQL = "SELECT MAX (TID) AS MAXTID FROM workflow "
SQL = SQL & "WHERE VZID = '"& VZID1 &"'"

obrec.open sql,obcon,3,3 <------Line 19

%>

I get this error:

Microsoft VBScript runtime error '800a01a8'

Object required: ''

/Joe/workflow/confirm.asp, line 19

I'm new to this, so any help would be greatly appreciated.

&quot;If nothing within you stays rigid, outward things will disclose themselves. Moving, be like water. Still, be like a mirror. Respond like an echo.&quot; ~ Bruce Lee
 
looks/sounds like your VZID1 value is null or empty, and if that field in the DB is numeric the quotes will fire off the error.
 
Response.Write SQL to check your query.

That might help you to locate the error.

VJ
 
the error could also be stating that either the rs of connection object have not been created prior to attempting to utitilize them

e.g.
obrec
obcon

___________________________________________________________________

The answer to your ??'s may be closer then you think.
Check out Tek-Tips knowledge bank by clicking the FAQ link at the top of the page faq333-3811
 
2 characters were wrong! OMG! Thanks everyone for your help.

&quot;If nothing within you stays rigid, outward things will disclose themselves. Moving, be like water. Still, be like a mirror. Respond like an echo.&quot; ~ Bruce Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top