CDatabase Open

M

magix

Hi,

I'm using Visual C++ and doing INSERT process into mdb file
May I know if it is possible to use Absolute path to specifiy mdb file ?
where mdb file is at the same directory as the executable.
How to change to accomodate absolution path in CDatabase Open ?


i.e
CString sDriver;
CString sDsn;
CString sFile;
CDatabase db;

sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)";
sFile = "my.mdb";

sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,sFile);
db.Open(NULL,false,false,sDsn);

Thanks.

Regards,
Magix
 
P

peter koch

Hi,

I'm using Visual C++ and doing INSERT process into mdb file
May I know if it is possible to use Absolute path to specifiy mdb file ?
where mdb file is at the same directory as the executable.
How to change to accomodate absolution path  in CDatabase Open ?

i.e
 CString sDriver;
 CString sDsn;
 CString sFile;
 CDatabase db;

 sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)";
 sFile = "my.mdb";

 sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,sFile);
 db.Open(NULL,false,false,sDsn);

Thanks.

Regards,
Magix

Better ask that in a microsoft forum. They have loads of knowledgeable
experts there (and the quesiton would be on-topic as well).

/Peter
 

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

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top