-
Oct 9th, 2024, 05:16 PM
#1
Thread Starter
New Member
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?
-
Oct 10th, 2024, 06:23 AM
#2
Thread Starter
New Member
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?
-
Oct 10th, 2024, 06:37 AM
#3
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
-
Oct 10th, 2024, 07:18 AM
#4
Thread Starter
New Member
Re: VB6 Problem to access accdb 2007
Originally Posted by Zvoni
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?
-
Oct 10th, 2024, 08:03 AM
#5
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).
-
Oct 10th, 2024, 08:07 AM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|