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!

Multiple Recordsets (Long Post)

Status
Not open for further replies.

minoad

Programmer
Mar 28, 2001
138
US
I am about to attempt something i have not done before. I believe the best way will be to use multiple recordsets. my code will look similar too:
dim adors
dim locrs
dim catrs
dim sqlstr
dim locsql
dim catsql

set adors= server.createobject ("adodb.recordset")
set locrs= server.createobject ("adodb.recordset")
set catrs= server.createobject ("adodb.recordset")
set sqlstr= "Select * from ABC where btype=(('" & cat & "')_
and blocation=('" & loc & "'));"
set locsql= "----code to fill drop down form----;"
set catsql= "----code to fill drop down form----;"

adors.open, sqlstr DSN="S215"
locrs.open, locsql DSN="S215"
locrs.open, catsql DSN="S215"

Sorry if any of this seems sophmoric. Just wanted some opinions before i actually ran with this code.
(This code was typed relatively quickly during lunch break so thier may be some syntax errors or spelling mistakes)


 
ADO is straight forward, looks good to me (except for the typos...hehehe)


smbure
 
One thing..

you should create one connection object
set conn = server.createobject("ADODB.connection")
conn.open "DSN=S215"

rs.open sql, conn
...

rs.close
conn.close

 
Is a connection object necassary. For whatever reason when i have tried to do that, i get errors stating that the dsn does not exist, but when i switch it to the recordset it works just fine.

Micah A. Norman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top