Link to home
Create AccountLog in
Avatar of rileo8
rileo8Flag for Italy

asked on

Open Pockect Access Database .cdb file from c++ or qt

Hi,

there is a way to open a .cdb file (Pocket Access Database) from c++ or qt?
Files are created on a windows ce platform but i need to open them in a program i'm developinf under windows xp.

Avatar of irfan_omair
irfan_omair
Flag of United States of America image

you can use ODBC plug-in driver to open this. So when you are trying to open .cdb first you need to build Qt's ODBC driver plugin. once you have it specify in your code what dirver are you using somthing like this:
QSqlDatabase myDb = QSqlDatabase::addDatabase("QODBC");
     
   myDb.setHostName("localhost");
   myDb.setDatabaseName("DRIVER={ Pockect Access Database  (*.cdb)};

Hope this helps
Avatar of rileo8

ASKER

I'm doing like this:


    db= QSqlDatabase::addDatabase("QODBC");
    db.setHostName("localhost");
    db.setDatabaseName("DRIVER={ Pockect Access Database  (*.cdb)}DBQ="+mdbFile);

Open in new window


but on:

db.open()

it gives me this error: QODBC3: unable to connect
I think connection string is wrong:
It is more than likely.

I am at work right now cant investigate it from here, can you google how to connect with this Data base using ODBC using other programing languge like .net or silverlight or any other tool, and trying using same connection string from Qt.

Let me know I think this should not be tough to find correct connection string.

Sorry i cant help much from my work place
ASKER CERTIFIED SOLUTION
Avatar of rileo8
rileo8
Flag of Italy image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of rileo8

ASKER

I didn't found a way to solve my problem so i simply change the way program works...