Information générale
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Opening an Access Table via ADO Code
Can anyone tell me the code to open a table in an Access database using code only? I am currently using a bound control with the Connection string as C:\database\database.mdb. The trouble with opening the db this way is when an end user installs the program to a directory other than c:\database.
Current code (that gives error... Object Variable or With block not set):
Dim sConnectionString As String
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Persist Security Info=False;" & _
"Data Source=" + App.Path + "\smdr1.mdb"
datPrimaryRS.ConnectionString = sConnectionString
datPrimaryRS.RecordSource = "Phone_Sys_Type_Data"
datPrimaryRS.Recordset.Open
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement