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!

Creating an ADO Recordset 2

Status
Not open for further replies.

Blondie96

Programmer
Aug 12, 2004
119
US
I am trying to create an ADO recordset from a table that exists within the current database, when I execute the code I get:

Run-time error '3709':
The connection cannot be used to perform this operation. It is either closed or invalid in this context.

the code is:

Dim rstData As ADODB.Recordset
Dim strSQL As String

Set rstData = New ADODB.Recordset

strSQL = "Select * From tblClassroomReservations"
rstData.Open strSQL, , adOpenDynamic, adLockOptimistic, adCmdText

any help is appreciated.

Thanks,
Tamra
 
One more question...

If I wanted to open another recordset with the same fields and format as tblclassroomReservations, but with no data, how could I accomplish that?
 
Select * From tblClassroomReservations Where 1=2

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I don't understand that select...

or does that just supply it a null result set (1 can't = 2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top