Could do with some cursor help please

can you go back to your Variable
declaration.

Try to declare the adoCon, adoCon2,
adoRS, adoRs2 as connection and
recordset respectively, then try
and click the button again:

Dim adoCon As ADODB.Connection
Dim adoCon2 As ADODB.Connection
Dim adoRs As ADODB.Recordset
Dim adoRs2 As ADODB.Recordset
 
got the error picture attached
 

Attachments

  • Image2.jpg
    Image2.jpg
    88.5 KB · Views: 104
on VBA menu->Tools->References
add reference to

Microsoft ActiveX Data Objects 2.8 or the latest 6.1 Library.
 
Okay I enabled 6.1 and got the attached image
 

Attachments

  • Image4.jpg
    Image4.jpg
    52.1 KB · Views: 87
got it working!

The latest error was caused (after your modifications) by me leaving a line of code in trying to close an already closed recordset.

The code is now displaying I believe meaningful numbers for the data.

I will check data and report back.

many thanks.
 
Chinchang, chingchang!

now the code is working, and you have
reference set, its time to
get rid of those CreateObject() method.

try using:

Set adoCon = New ADODB.Connection
Set adoCon = New ADODB.Connection
Set adoRs = New ADODB.Recordset
Set adoRS2 = New ADODB.Recordset
 
I saw the duplication in the creation connection and recordsets. I'll delete the "create" ones and report back.
Thank you.
 
All done and dusted, returning a correct value. It would be really useful if I could find the values of the records that are returned from the recordset as not meeting criteria but I can't find a method or property that will allow that.

many thanks arnelgp
 

Users who are viewing this thread

Back
Top Bottom