CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2009
    Posts
    98

    [VB6] - Connect Microsoft access 2010 dbase to a VB6 project issue

    Hello all

    I used to use this code bellow for accessing an access 2007 dbase but it looks like 2010 is not the same.
    I'm also on windows 7 64

    I have this error:
    "Run time error 3706 Provider cannot be found, it may not be properly installed" on this part of the code: Conn.Open

    How can i fix this?

    Thanks again for your help

    Code:
    Dim Conn As ADODB.Connection
    Dim Conns As String
    Dim oRST1 As ADODB.Recordset
    Set oRST1 = New ADODB.Recordset
      
    Set Conn = New ADODB.Connection
    Conns = "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=" & Form2.txtBaseDelabsolution.Text
    Conn.ConnectionString = Conns
    Conn.Open
    nom.AddItem ""
    oRST1.Open Conns, Conn
    Do Until oRST1.EOF
      nom.AddItem oRST1("Nom")
      oRST1.MoveNext
    Loop

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: [VB6] - Connect Microsoft access 2010 dbase to a VB6 project issue

    Have you tried replacing :

    Code:
    Conns = "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=" & Form2.txtBaseDelabsolution.Text
    With :

    Code:
    Conns = "Provider=Microsoft.ACE.OLEDB.14.0;" & "Data Source=" & Form2.txtBaseDelabsolution.Text
    ?
    Also, have you updated the References?

  3. #3
    Join Date
    Aug 2009
    Posts
    98

    Re: [VB6] - Connect Microsoft access 2010 dbase to a VB6 project issue

    Hi HanneSThEGreaT

    I just tried and same error

    Code:
    Conn.Open

    Full code
    Code:
    Dim Conn As ADODB.Connection
    Dim Conns As String
    Dim oRST1 As ADODB.Recordset
    Set oRST1 = New ADODB.Recordset
      
    Set Conn = New ADODB.Connection
    Conns = "Provider=Microsoft.ACE.OLEDB.14.0;" & "Data Source=" & Form2.txtBaseDelabsolution.Text
    Conn.ConnectionString = Conns
    Conn.Open
    nom.AddItem ""
    oRST1.Open Conns, Conn
    Do Until oRST1.EOF
      nom.AddItem oRST1("Nom")
      oRST1.MoveNext
    Loop
    here are also the references i have
    References.jpg

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured