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

ADO Recordset...

Status
Not open for further replies.

eves

Programmer
Jul 29, 2001
18
0
0
SG
Hmm...what is wrong with this...

adoInfo.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
App.Path & "\testpassw.mdb;Persist Security Info=False"

adoInfo.RecordSource = "SELECT * FROM NumOfUsers"

NumOfUsers = adoInfo.Recordset("NumOfUsers")

They said <Object variable or With variable not set>

I can't get the NumOfUsers to get the value from the DB. Where did i go wrong..?

Thanks
 
Did you dim (and Set) your adoInfo variable as an ado connection object? The error means that you're trying to access an object that you haven't created yet...
 
hmm.... I'm using an ADO control....so i'm not really sure if i need to initialise it. =)

anyways...how do u initialise it..?

dim rs as adodb.recordset? (or should it be adodb.command?)

set rs = new adodb.recordset?
 
Not really familiar with the ado controls, but if I would venture a guess it would be that up to the point where you call the recordset property the underlying ADO-connection need not bee open.

Check for a method that opens the ADO and executes your query before referencing the results of that query.

Good Luck
-Mats
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top