MiRRoR
asked on
Connecting to .DBs Database from Visual Basic
I need to find out how it is possible to ,
Through Visual Basic, Connect to a database file eg. Data.DBs!
Please could anyone help me! ASAP
Nice points are up for grabs!
MiRRoR
Through Visual Basic, Connect to a database file eg. Data.DBs!
Please could anyone help me! ASAP
Nice points are up for grabs!
MiRRoR
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
this is from SQLServer:
dim con as new adodb.connection
con.open "Provider=SQLOLEDB.1;Persi st Security Info=True;User ID=<login>;password=<pwd>; Initial Catalog=<dbname>;Data Source=<ServerName>"
dim con as new adodb.connection
con.open "Provider=SQLOLEDB.1;Persi
this is for SQLServer:
dim con as new adodb.connection
con.open "Provider=SQLOLEDB.1;Persi st Security Info=True;User ID=<login>;password=<pwd>; Initial Catalog=<dbname>;Data Source=<ServerName>"
dim con as new adodb.connection
con.open "Provider=SQLOLEDB.1;Persi
ASKER
DBF Files
Try the method to open the connection
str_Connection = "Provider=MSDASQL.1;Driver =Microsoft Visual FoxPro Driver;UID=;PWD=;SourceDB= " & Directory Path where the dbf files exists & ";SourceType=DBF;Exclusive =No;Backgr oundFetch= Yes;Collat e=Machine; Null=Yes;D eleted=Yes ;"
Cn.Open str_Connection
Cn.DefaultDatabase = Directory Path where the dbf files exists
'' selecting records from the dbf file
rs.open "select * from dbffilename "
this will definately work.
Regards
JBS
str_Connection = "Provider=MSDASQL.1;Driver
Cn.Open str_Connection
Cn.DefaultDatabase = Directory Path where the dbf files exists
'' selecting records from the dbf file
rs.open "select * from dbffilename "
this will definately work.
Regards
JBS
Paste the connection string into your code like:
Set CN=New ADODB.Conection
CN.ConnectionString = "......."
CN.Open
Now you can use the Connection to open your database.