launch Excel failed

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,
 
S

Souris

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,
 
S

Stefan Hoffmann

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 <--
 
S

Souris

Thanks for the message,
I do not remember details.
I will go to user machine and check it.

Thanks again,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top