Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    24

    Unanswered: ADO connection failing -- access 2002

    I have an active connection I assume when an access database is open.

    Can I then open a second connection to the same database using ADO.

    I have a table where records are children of other records, in an indefinite number of levels.

    On a continuous form, I have a checkbox that when clicked updates that records children's visibility. So enabling a tree like record structure where you can set and unset the visibility of a records children as and when required.

    The process is not getting past the connection.open statement. It reports 3706 "Provider cannot be found....."

    Private Sub ChildrenOpen_AfterUpdate()
    DoCmd.RunCommand acCmdSaveRecord
    SetChildrenVisibility
    End Sub

    Private Sub SetChildrenVisibility()
    Dim rst As ADODB.Recordset
    Dim strCriteria As String
    Dim strMessage As String
    Dim strRst As String
    Dim mark As Variant
    Dim cnn As ADODB.Connection


    intCurRecord = Forms![tasks subform].TaskID

    Set cnn = New ADODB.Connection

    cnn.Provider = "Provider=Microsoft.Jet.OLEDB.4.0"
    cnn.Open "y:\taskbase2.mdb", "admin", ""

    .............

    Any help appreciated

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by CallMeAndy
    I have an active connection I assume when an access database is open.

    Can I then open a second connection to the same database using ADO.
    Hi Andy

    Yes you can so long as you don't end up locking the db. However, why would you want to? Why open a second connection if you have one already? What happens if you just use your first connection?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jan 2005
    Posts
    24
    A good question.
    I was intending to use rst = me.RecordSetClone without the connection bother.
    with Dim rst as RecordSet

    However I could not get away from Type mismatch error.

    I could have asked a question about ths too of course but by the time I came to ask for help on the forum I had already reworked the code.

    Still would like to know if anyone can explain to me about the database connection issue or indeed the Type mismatch issue?

    This immediate problem has been dealt with however by coding thus:

    Set rst = New ADODB.Recordset

    ' projectOrder is by pos
    strRst = projectSelect + " " + projectWhere + " " + projectOrder
    rst.Open strRst, CurrentProject.Connection, adOpenStatic, adLockOptimistic

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •