L
Les Gombart
I have an excel sheet that uses Access tables in the background to store
information... The file has been functioning, but for various reasons, I
needed to change the name of the Access file from "PDAv1_be.mdb" with a table
called "clients", to "PDAdatabase.mdb" with a table called database.
I now keep getting an error saying that input table or query "clients"
cannot be found. When I change the script to "database", I get an error
"Syntax error in FROM clause".
The code causing the problem is pasted below...
------------------------------------------------------------
databasefile = Admin.Range("B3").Value
'Open the connection to the PDA Database
Set Connection = New ADODB.Connection
Cnct = "Provider = Microsoft.Jet.OLEDB.4.0; "
Cnct = Cnct & "Data Source=" & databasefile & ";"
Connection.Open ConnectionString:=Cnct
'Create recordset
Set rstimportbrand = New ADODB.Recordset
rstimportbrand.Open "database", Connection, adOpenKeyset, adLockOptimistic,
adCmdTable
I would REALLY appreciate it if someone could point me in the right direct...
NB using Excel 2007
information... The file has been functioning, but for various reasons, I
needed to change the name of the Access file from "PDAv1_be.mdb" with a table
called "clients", to "PDAdatabase.mdb" with a table called database.
I now keep getting an error saying that input table or query "clients"
cannot be found. When I change the script to "database", I get an error
"Syntax error in FROM clause".
The code causing the problem is pasted below...
------------------------------------------------------------
databasefile = Admin.Range("B3").Value
'Open the connection to the PDA Database
Set Connection = New ADODB.Connection
Cnct = "Provider = Microsoft.Jet.OLEDB.4.0; "
Cnct = Cnct & "Data Source=" & databasefile & ";"
Connection.Open ConnectionString:=Cnct
'Create recordset
Set rstimportbrand = New ADODB.Recordset
rstimportbrand.Open "database", Connection, adOpenKeyset, adLockOptimistic,
adCmdTable
I would REALLY appreciate it if someone could point me in the right direct...
NB using Excel 2007