Click to See Complete Forum and Search --> : ADO and OLEDB provider


kebinlu
May 30th, 2001, 10:18 AM
I have developed a application by Visual C++ 6.0, in which I have use ADO and
OLE provider to access a database(For example:temp.mdb),some codes as following:

...
_ConnectionPtr pCon;
CString strcnn("Provider=Microsoft.Jet.OleDB.4.0;Data Source=temp.mdb");
pCon->Open(strcnn,"","",NULL);
...

When I do debuging, Application can access Database well, but When I want to
deploy application , I try to intall on Windows 98, While I start application from Start/Program/xxx
application failed to access database (temp.mdb), What can I do?
All suggestion will be welcome, thanks.

sheetal
June 6th, 2001, 02:27 PM
You have hard coded the location of the database in your connection string. Have you ensured that the machine on which you are installing the program has the same direct path?
If it is different machine then the location of the database will different (Different path). When you debug the program, you would be using your machine, and so can locate the database.
Check the path you have specified.

Hope this helps.
Thanks.

salman khan
June 7th, 2001, 06:07 AM
make sure u give complete path to database in the connection string. moreover the path must be registry based i.e where the user installs the application.
Regards

kebinlu
June 16th, 2001, 11:23 PM
I have solved this problem. thanks for your help!!!