TheSwamp
Code Red => VB(A) => Topic started by: Amsterdammed on November 16, 2007, 04:43:50 AM
-
Hello everybody,
I got some wonderfull code here on this Forum to connect Excel to Access and vice versa. It works fine, so I can send data from Excel to an access.mdb file to append it. It uses the
Dim rs As New ADODB.Recordset '// you can use As Object for the late binding
Dim SQLstr As String
On Error GoTo Err_Control
Set cnn = CreateObject("ADODB.Connection")
SQLstr = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & dbPath & ";" & _
"Jet OLEDB:Engine Type=4"
cnn.Open SQLstr
as connection.
So far so good, but i can't write to older versions off Access with that driver, so my question for today is, is there simply another driver i can use to connect to that type of mdb file??
Thanks in Advance
Bernd
-
Hi
Try following
Open database, switch to VBAIDE, insert module
then add this code into module:
Option Compare Database
Option Explicit
Sub GetConnString()
MsgBox CurrentProject.BaseConnectionString
End Sub
Not sure about it will be work in 97 I can't test it
~'J'~
-
You need to use jet 3.51 for access 97
http://support.microsoft.com/default.aspx/kb/172733
so you might need to change your provider to something like
"Provider=Microsoft.Jet.OLEDB.3.51;"
-
The point is that i have XP on my computer, but the vertical i have to deal with has that bdase still in access 97.
-
If i set it to 3.51, i get an error msg that the provider might not be installed properly, makes sense, i don't have Office 97 on my PC.
-
I dont think you need office 97 installed on your computer, only the jet divers. The example I gave you was just, off the top of my head,You will need to research the provider. Obviously the vertical youre using can Read/Write to access 97, so you can too. :wink:
What did the vertical install? Did you try adding a reference to the 3.51 library?
-
Daniel,
Obviously the vertical youre using can Read/Write to access 97, so you can too
Thought so, too
How should the reference be called? :?
Thanks Bernd