Specifying "Current" Jet Database Using ADO 
Author Message
 Specifying "Current" Jet Database Using ADO

How do you specify the "current database" when opening an ADO connection?  I
seem to recall reading at one time in the documentation on how to do it, but
can not find it now.  Just being lazy in terms of not wanting to provide a
fully qualified path to the database file since the subroutine is within the
Access database it will be operating on.

Thanks!!

Don

Public Sub RevisionBaseliner()

    Dim cnnDataBase As ADODB.Connection
    Dim rstSignalNames As ADODB.Recordset
    Dim strCnn As String
    Dim varDate As Variant

    ' Open connection.
        strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""X_ACU"""
    Set cnnDataBase = New ADODB.Connection
    cnnDataBase.Open strCnn

    ' Open Front Panel Connector table.
    Set rstSignalNames = New ADODB.Recordset
    rstSignalNames.CursorType = adOpenDynamic
    rstSignalNames.LockType = adLockOptimistic
    rstSignalNames.Open "tblExternalConnectors", cnnDataBase, , , adCmdTable

    rstSignalNames.MoveFirst

    Do While rstSignalNames.EOF = False

        Debug.Print rstSignalNames![SignalName]

    Loop

    rstSignalNames.Close
    cnnDataBase.Close



Mon, 27 Oct 2003 23:30:56 GMT  
 Specifying "Current" Jet Database Using ADO


Quote:
> How do you specify the "current database" when opening an ADO connection?
I
> seem to recall reading at one time in the documentation on how to do it,
but
> can not find it now.  Just being lazy in terms of not wanting to provide a
> fully qualified path to the database file since the subroutine is within
the
> Access database it will be operating on.

> Thanks!!

> Don

> Public Sub RevisionBaseliner()

>     Dim cnnDataBase As ADODB.Connection
>     Dim rstSignalNames As ADODB.Recordset
>     Dim strCnn As String
>     Dim varDate As Variant

>     ' Open connection.
>         strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""X_ACU"""
>     Set cnnDataBase = New ADODB.Connection
>     cnnDataBase.Open strCnn

>     ' Open Front Panel Connector table.
>     Set rstSignalNames = New ADODB.Recordset
>     rstSignalNames.CursorType = adOpenDynamic
>     rstSignalNames.LockType = adLockOptimistic
>     rstSignalNames.Open "tblExternalConnectors", cnnDataBase, , ,
adCmdTable

>     rstSignalNames.MoveFirst

>     Do While rstSignalNames.EOF = False

>         Debug.Print rstSignalNames![SignalName]

>     Loop

>     rstSignalNames.Close
>     cnnDataBase.Close



Tue, 28 Oct 2003 01:11:39 GMT  
 Specifying "Current" Jet Database Using ADO


But you can't help here?  

How odd.

--
Mike Sherrill
Information Management Systems



Thu, 30 Oct 2003 01:39:07 GMT  
 Specifying "Current" Jet Database Using ADO
Me thinks Tony buddy is trying to drum up some business for
himself.

He isn't interested in sharing with us.

Quote:




> > How do you specify the "current database" when opening an ADO connection?
> I
> > seem to recall reading at one time in the documentation on how to do it,
> but
> > can not find it now.  Just being lazy in terms of not wanting to provide a
> > fully qualified path to the database file since the subroutine is within
> the
> > Access database it will be operating on.

> > Thanks!!

> > Don

> > Public Sub RevisionBaseliner()

> >     Dim cnnDataBase As ADODB.Connection
> >     Dim rstSignalNames As ADODB.Recordset
> >     Dim strCnn As String
> >     Dim varDate As Variant

> >     ' Open connection.
> >         strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""X_ACU"""
> >     Set cnnDataBase = New ADODB.Connection
> >     cnnDataBase.Open strCnn

> >     ' Open Front Panel Connector table.
> >     Set rstSignalNames = New ADODB.Recordset
> >     rstSignalNames.CursorType = adOpenDynamic
> >     rstSignalNames.LockType = adLockOptimistic
> >     rstSignalNames.Open "tblExternalConnectors", cnnDataBase, , ,
> adCmdTable

> >     rstSignalNames.MoveFirst

> >     Do While rstSignalNames.EOF = False

> >         Debug.Print rstSignalNames![SignalName]

> >     Loop

> >     rstSignalNames.Close
> >     cnnDataBase.Close



Fri, 07 Nov 2003 09:27:51 GMT  
 Specifying "Current" Jet Database Using ADO
if people are still looking for an answer...

set cn = CurrentProject.Connection

HTH,

Jux



Quote:
> Me thinks Tony buddy is trying to drum up some business for
> himself.

> He isn't interested in sharing with us.





> > > How do you specify the "current database" when opening an ADO
connection?
> > I
> > > seem to recall reading at one time in the documentation on how to do
it,
> > but
> > > can not find it now.  Just being lazy in terms of not wanting to
provide a
> > > fully qualified path to the database file since the subroutine is
within
> > the
> > > Access database it will be operating on.

> > > Thanks!!

> > > Don

> > > Public Sub RevisionBaseliner()

> > >     Dim cnnDataBase As ADODB.Connection
> > >     Dim rstSignalNames As ADODB.Recordset
> > >     Dim strCnn As String
> > >     Dim varDate As Variant

> > >     ' Open connection.
> > >         strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=""X_ACU"""
> > >     Set cnnDataBase = New ADODB.Connection
> > >     cnnDataBase.Open strCnn

> > >     ' Open Front Panel Connector table.
> > >     Set rstSignalNames = New ADODB.Recordset
> > >     rstSignalNames.CursorType = adOpenDynamic
> > >     rstSignalNames.LockType = adLockOptimistic
> > >     rstSignalNames.Open "tblExternalConnectors", cnnDataBase, , ,
> > adCmdTable

> > >     rstSignalNames.MoveFirst

> > >     Do While rstSignalNames.EOF = False

> > >         Debug.Print rstSignalNames![SignalName]

> > >     Loop

> > >     rstSignalNames.Close
> > >     cnnDataBase.Close



Sun, 09 Nov 2003 01:07:14 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. VB6 ADO, Jet "Error initializing provider"

2. VB6 ADO, Jet "Error initializing provider"

3. VB6 ADO, Jet "Error initializing provider"

4. ADO querry using "ADsDSOObject" in VBScript

5. specifying directory for "print to file"

6. Using "Unique Table" on Access database

7. ADO could not find the specified providers"

8. "[ADODC]: No RecordSource Specified.[ADO]: No command text

9. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

10. Problem understanding "Current Record" on form

11. "Operation invalid without current index"

12. Combine 2 "On Current"

 

 
Powered by phpBB® Forum Software