ADO Error! Don't know why 
Author Message
 ADO Error! Don't know why

Hi, I'm trying to open a recordset from a database using an ado data control.

I've used the property window to assign the data control's properties including the connection string and the recordsourse which is a table in the database.

in the code the first line using the adodc1.recordset object gives me an error. Error is 'Object variable or With Block variable not set'.

The line is:       Adodc2.Recordset.MoveFirst

Whatever I do I get this error. I have testec the connection and it was successful. I don't know what I am missing out or doing wrong. Can anyone help urgently????

N Savjani

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Sat, 13 Dec 2003 23:02:42 GMT  
 ADO Error! Don't know why

Generally one should, or even must create variables in database programming. Also, it will help you zero in on the problem.

Try something like

dim rs as adodb.recordset
set rs=adodc2.recordset
rs.movefirst

Then you should at least be able to find the specific problem.
Also, I would name the ado something more meaningful, such as adoEmployees or whatever.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 14 Dec 2003 06:44:27 GMT  
 ADO Error! Don't know why
Thanks Ralph,

I did try what you suggested but I still get the same error.
My connection string for the adodc1 datacontrol is set to:

Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=R:\LMP2\Database\DatabaseName.mdb

I have used this connection string before in other programs and did not have any such problems then. Could there be anything else that I may have missed out (as I am a new VB programmer)?
Any help would be great!

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 14 Dec 2003 17:20:23 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Migration to VS 2003 worked though I don't know why

2. does anybody know why this code don't work

3. I don't know why..

4. PLS Help, I don't know why to write

5. VB4 16bit GPF and I don't know why (I bother sometimes)

6. I don't know why..

7. PLS Help, I don't know why to write

8. syntax error but don't know where

9. Getting Error 13, help - don't understand why

10. don't know how to handle error

11. Why don't my exe's and ocx's unregister

12. ADO don't catch sp error

 

 
Powered by phpBB® Forum Software