|
-
Sep 8th, 2000, 12:19 AM
#1
Thread Starter
New Member
I Have office 2000 in my machine.
I want to connect VB with Access with the help of data control. In the data control property I am selecting the database name but when I am selecting the record source property to select the table name it is giving an error "Unrecognised database format <File Name>.mdb" .
But when I am selecting the default database(biblio.mdb) it does not giving any error.
I cannot find the problem.
Please help me.
Thank u in advance.
-
Sep 8th, 2000, 04:09 AM
#2
Lively Member
biblo.mdb is not Access 2000, it is Access 97 which the Data Control will accept. If you want to connect to an Access 2000 database, then you need to use ADO rather than DAO. Try this code snippet below which tells you how to open an ADO DB and Recordset (beware, personally I hate ADO and would much rather stick to Access 97 instead of 2000)
dim SysDB as ado.database
dim rsTest as ado.recordset
SysDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & {Path to database as string}
SysDB.Mode = adModeReadWrite
SysDB.Open
rstest.open "TestTable",SysDB, adOpenKeyset, adLockOptimistic,adcmdtable
in this open bit, the "TestTable" is a table in the database, sysdb is an ADO database. If you want to open an SQL statement, then change the "TestTable" bit to the sql statement and change the adcmdTable bit at the end to adCmdText.
Hope this helps
Chris
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
|