launch Excel failed

  • Thread starter Thread starter Souris
  • Start date Start date
S

Souris

I have a Excel spreadsheet to run function and retrieve data from Access
database.

My Excel is able to launch MS Access, but one machine is failed to run it
automatically.

I can manually run the MS Access application and the Excel still can run the
function and get data.

I would like to run the MS Access application automatically.

what could be problem?
Is it posssible the machine missing some dll?
If yes, Excel can get data from database.

The code is failed when the Excel open ADO connection.

Your information is great appreciated,
 
Dim DbPath As String
Dim MyConnection As String
Dim MySQL As String

On Error GoTo Err_Workbook_Open

DbPath = "D:\MyDB\MyDb.mdb"

MyConnection = "Provider=Microsoft.Jet.OLEDB.4.0;"
MyConnection = MyConnection & "Data Source=" & DbPath & ";"

MySQL = "SELECT COUNT(*) FROM tblMyTable WHERE USERID = " & """" & "MyID" &
""""

Set MyDatabase = CreateObject("adodb.recordset")
MyDatabase.Open MySQL, MyConnection, 0, 1, 1

The code failed at "MyDatabase.Open MySQL, MyConnection, 0, 1, 1"

Only one machine fails to open the connection.
It works when I manual to run the mdb.

Thanks again,
 
hi,
The code failed at "MyDatabase.Open MySQL, MyConnection, 0, 1, 1"
Only one machine fails to open the connection.
What error message do you get?


mfG
--> stefan <--
 
Thanks for the message,
I do not remember details.
I will go to user machine and check it.

Thanks again,
 
Back
Top