Results 1 to 6 of 6

Thread: VB6 Problem to access accdb 2007

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2024
    Posts
    10

    VB6 Problem to access accdb 2007

    I'm currently having a big problem accessing an ACCDB 2007 from my VB6 program using Microsoft.ACE.OLEDB.12.0. Access no longer works on the customer computer. So far everything has worked smoothly. Which component do I have to install on the target computer so that I can access the accdb again? Is a specific DLL sufficient or is there a special installation package?

  2. #2

    Thread Starter
    New Member
    Join Date
    Sep 2024
    Posts
    10

    Re: VB6 Problem to access accdb 2007

    Here my code

    Code:
    Option Explicit
    Private objConnection As New ADODB.Connection
    
    Public Function OpenConnection(blnProgressBar As Boolean) As Boolean
        On Error GoTo ErrorHandler
        OpenConnection = False
        
        With objConnection
            .CursorLocation = adUseClient
            .Mode = adModeShareDenyNone
            
            strDatabase = App.Path + "\" + App.EXEName + ".accdb"
            
            strProvider = "Microsoft.ACE.OLEDB.12.0"       
            .Provider = strProvider       
            .Properties("Data Source") = strDatabase
                   
             strDatabasePassword = "....."       
             .Properties("Jet OLEDB:Database Password") = strDatabasePassword
            .Open
            
        End With    
        
        OpenConnection = True
        Exit Function
        
    ErrorHandler:
    End Function

    I use these references. What combination of references do you recommend so that database access via VB6 works again? Is there perhaps a third-party component that can be used to easily access ACCDB 2007?

    Microsoft ActiveX Data Objects 2.8 Library
    Microsoft ActiveX Data Objects Recordset 2.8 Library
    Microsoft Data Binding Collection VB 6.0 (SP4)
    Microsoft Data Environment 1.0
    Microsoft Data Formatting Object Library 6.0 (SP4)
    Microsoft Jet and Replication Objects 2.6 Library

    Both the 32bit and 64bit drivers are installed on the target computer. Is it perhaps a problem that both drivers are installed?

  3. #3
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,787

    Re: VB6 Problem to access accdb 2007

    VB6 is 32-Bit.
    I think to remember, there being Problems if both drivers were installed.
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2024
    Posts
    10

    Re: VB6 Problem to access accdb 2007

    Quote Originally Posted by Zvoni View Post
    VB6 is 32-Bit.
    I think to remember, there being Problems if both drivers were installed.
    is it possible to deinstall the 64bit version? maybe other programs need the 64bit version. is it possible to connect only the 32bit driver?

  5. #5
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,506

    Re: VB6 Problem to access accdb 2007

    this is the only reference you really need to use that Access Database:

    Microsoft ActiveX Data Objects 2.8 Library
    Although it won't make a difference in this case, you should be using the & sign instead of the + sign when concatenating strings (+ is for numeric operations).

    Change strDatabase = App.Path + "" + App.EXEName + ".accdb"

    to
    strDatabase = App.Path & "" & App.EXEName & ".accdb"
    Sam I am (as well as Confused at times).

  6. #6
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,506

    Re: VB6 Problem to access accdb 2007

    Weird Forum issue....even though i put a slash between the double quotes, it didn't appear in either line in my last post...it should be there!

    strDatabase = App.Path & "" & App.EXEName & ".accdb"
    Sam I am (as well as Confused at times).

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