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

Is the best way to do a singleton select - asp/Access?

Status
Not open for further replies.

humour

Programmer
Nov 24, 2003
87
QueryStr = "Select UpdDateTime From ctTable
where ID= 1 "

rsQuery.Open QueryStr, DB, adOpenForwardOnly, adLockReadOnly

If Not(rsQuery.eof) Then
DT = rsQuery.fields("UpdDAteTime")
End IF

etc...
 
if you're just using this for datareturn/variable assignment... removing all the arguments will make life a little easier, and the code less complicated to debug later.
most instances of recordsets are not needed for active update/delete/etc, so creating a "ADODB.RECORDSET" is not typically needed

set connection = server.createobject("adodb.connection")
connection.open connectionString

QueryStr = "Select UpdDateTime From ctTable where ID=1"

set rsobject = connection.execute(querystr)
if not rsobject.eof then
<CLIP>

[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top