ODBC : Invalid argument

Y

yanto

Hi,
I am using VB6 to open ms access database via ODBC, my DSN is "Local"
using password (have set inside DSN).
My code is:

strConn = "ODBC;DATABASE=;UID=;PWD=;DSN=Local"
Set wrk = CreateWorkspace("NewODBCWrk", "admin", "",
dbUseODBC) '
Set con = wrk.OpenConnection("", dbDriverNoPrompt + dbRunAsync,
False, strConn)

Set rst = con.OpenRecordset("tblNumbers", dbOpenDynamic, 0,
dbOptimisticBatch)

when I run this code I got an error "Invalid argument" and stop at
"openrecordset"
my project-references are:

visual basic for application
visual basic runtime object and procedure
visual basic object and procedure
ole automation
microsoft data binding collecton
microsoft DAO 3.6 object library

mu access database is ms access 2000 format
How to solve this problem? I got stuck on this, have searched on the
net and followed the advises but still got an error.
TIA
Yanto
 

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