ADO Recordset object problem 
Author Message
 ADO Recordset object problem

Hello;

I am trying to make a single temporary connection to a database file using
the Recordset object of ADO.

After setting up the DataLink, setting the reference to the ADO active x
object and entering the code I get this error message:

  Run time error' -2147287038 (80030002)':
   %1 could not be found.

Here is the code:

Private Sub Form_Load()
Dim m_Recordset As ADODB.Recordset
Set m_Recordset = New ADODB.Recordset

m_Recordset.Open "SELECT  Name  FROM  Publishers", _
   "File Name=C:\Program Files\Common Files\System\ole db\Biblio.udl"

  (Biblio is the database file)

 ( from here I'm filling a list box with Publishers)

do while not m_Recordset.EOF
 list1.addItem m_Recordset!Name
 m_Recordset.MoveNext
Loop

End Sub

VB is telling me that this is the offending code:

m_Recordset.Open "SELECT  Name  FROM  Publishers", _
   "File Name=C:\Program Files\Common Files\System\ole db\Biblio.udl"
                             (path to datalink file)

Any help as to why it will not run is greatly appreciated

           Thanx



Tue, 04 Feb 2003 03:00:00 GMT  
 ADO Recordset object problem
You need a connection object.


Quote:
> Hello;

> I am trying to make a single temporary connection to a database file using
> the Recordset object of ADO.

> After setting up the DataLink, setting the reference to the ADO active x
> object and entering the code I get this error message:

>   Run time error' -2147287038 (80030002)':
>    %1 could not be found.

> Here is the code:

> Private Sub Form_Load()
> Dim m_Recordset As ADODB.Recordset
> Set m_Recordset = New ADODB.Recordset

> m_Recordset.Open "SELECT  Name  FROM  Publishers", _
>    "File Name=C:\Program Files\Common Files\System\ole db\Biblio.udl"

>   (Biblio is the database file)

>  ( from here I'm filling a list box with Publishers)

> do while not m_Recordset.EOF
>  list1.addItem m_Recordset!Name
>  m_Recordset.MoveNext
> Loop

> End Sub

> VB is telling me that this is the offending code:

> m_Recordset.Open "SELECT  Name  FROM  Publishers", _
>    "File Name=C:\Program Files\Common Files\System\ole db\Biblio.udl"
>                              (path to datalink file)

> Any help as to why it will not run is greatly appreciated

>            Thanx



Tue, 18 Feb 2003 09:08:04 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem reusing ADO.Recordset object in VBA script in Excel

2. MDAC ado data object recordset reference problem

3. problem: cloning a disconnected ADO recordset from a class object

4. Question on Problem encountered w/ using ADODC DataControl.Recordset Property w/ ADODB.Recordset objects

5. Question on Problem encountered w/ using ADODC DataControl.Recordset Property w/ ADODB.Recordset objects

6. Open ADO recordset on another ADO recordset - possible?

7. Setting the recordset for a form with an ADO command object

8. Passing variables to an ADO Command or RecordSet Object in another frame

9. Query agains an ADO recordset object

10. Combo box bound to ADO recordset object?

11. VB OOP question: Passing ADO recordsets among objects!

12. VB6 - MSSQL Server 7 - ADO - Assigning NULL to field in RecordSet object

 

 
Powered by phpBB® Forum Software