[RESOLVED] Connection string for dbase files
I have code below, How I can connect the dbase files (Microsoft visual pro) using ADODB connection? I got the code below but it use microsoft access to connect the database.
Code:
Dim strDB, strConn As String
'Set New connection
Set cnnACC = New ADODB.Connection
'String Database Path
strDB = TextBox1.Text
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDB & ";Persist Security Info=False"
' Open the connection
cnnACC.Open strConn
Re: Connection string for dbase files
Here's what I found
Code:
DBase ODBC Connection String
Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=c:\directory;
DBase OLEDB Connection String
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\directory;Extended Properties=dBASE IV;User ID=Admin;Password=
Re: Connection string for dbase files
matrik02: You should bookmark this site:
http://www.connectionstrings.com
1 Attachment(s)
Re: Connection string for dbase files
Why I got that error message? It point me at this line
rst.Open sSQL, cnnACC, adOpenDynamic, adLockOptimistic
My dbf files location is here
D:\Sourcecode\Add table from dbase\table.dbf
Code:
Dim strConn As String
Dim sSQL As String
'Set New connection
Set cnnACC = New ADODB.Connection
Set rst = New ADODB.RecordSet
strConn = "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=D:\Sourcecode\Add table from dbase;"
cnnACC.Open strConn
sSQL = "SELECT * FROM table"
rst.Open sSQL, cnnACC, adOpenDynamic, adLockOptimistic
Re: Connection string for dbase files
Is your database name "Add table from dbase" with no file extension?