Problem with ODBC connection
-
Hello. I'm trying to get connection to dBase file by using ODBC. I'm trying to use code like this:
CDatabase cdb; cdb.OpenEx( _T("DBQ=F:\\database\\a.dbf;DefaultDir=F:\\database\\;DRIVER=Microsoft dBASE Driver (*.dbf);DriverId=533;MaxBufferSize=2048;PageTimeout=5;"));
But i get message: string F:\database\a.dbf is an invalid path. But this file exactly exists!!! I'm using Visual Studio 2005. How should I solve the problem please? -
Hello. I'm trying to get connection to dBase file by using ODBC. I'm trying to use code like this:
CDatabase cdb; cdb.OpenEx( _T("DBQ=F:\\database\\a.dbf;DefaultDir=F:\\database\\;DRIVER=Microsoft dBASE Driver (*.dbf);DriverId=533;MaxBufferSize=2048;PageTimeout=5;"));
But i get message: string F:\database\a.dbf is an invalid path. But this file exactly exists!!! I'm using Visual Studio 2005. How should I solve the problem please? -
Hello. I'm trying to get connection to dBase file by using ODBC. I'm trying to use code like this:
CDatabase cdb; cdb.OpenEx( _T("DBQ=F:\\database\\a.dbf;DefaultDir=F:\\database\\;DRIVER=Microsoft dBASE Driver (*.dbf);DriverId=533;MaxBufferSize=2048;PageTimeout=5;"));
But i get message: string F:\database\a.dbf is an invalid path. But this file exactly exists!!! I'm using Visual Studio 2005. How should I solve the problem please?It looks like the smiley-face-tongue-sticking-out may be the problem. Otherwise, what led mike said. Mark
-
Hello. I'm trying to get connection to dBase file by using ODBC. I'm trying to use code like this:
CDatabase cdb; cdb.OpenEx( _T("DBQ=F:\\database\\a.dbf;DefaultDir=F:\\database\\;DRIVER=Microsoft dBASE Driver (*.dbf);DriverId=533;MaxBufferSize=2048;PageTimeout=5;"));
But i get message: string F:\database\a.dbf is an invalid path. But this file exactly exists!!! I'm using Visual Studio 2005. How should I solve the problem please?It's just a guess, but do you need to put
ODBC;
before DBQ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Hello. I'm trying to get connection to dBase file by using ODBC. I'm trying to use code like this:
CDatabase cdb; cdb.OpenEx( _T("DBQ=F:\\database\\a.dbf;DefaultDir=F:\\database\\;DRIVER=Microsoft dBASE Driver (*.dbf);DriverId=533;MaxBufferSize=2048;PageTimeout=5;"));
But i get message: string F:\database\a.dbf is an invalid path. But this file exactly exists!!! I'm using Visual Studio 2005. How should I solve the problem please?Hi Only for test purposes try to change the location. I guess that file is in a network path. Regards David Leyva
-
Hello. I'm trying to get connection to dBase file by using ODBC. I'm trying to use code like this:
CDatabase cdb; cdb.OpenEx( _T("DBQ=F:\\database\\a.dbf;DefaultDir=F:\\database\\;DRIVER=Microsoft dBASE Driver (*.dbf);DriverId=533;MaxBufferSize=2048;PageTimeout=5;"));
But i get message: string F:\database\a.dbf is an invalid path. But this file exactly exists!!! I'm using Visual Studio 2005. How should I solve the problem please?did you create a DSN ?
WhiteSky
-
did you create a DSN ?
WhiteSky
-
Jackson86 wrote:
...the other computer?
What other computer?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Jackson86 wrote:
...the other computer?
What other computer?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
I meant that, if i will create my DSN in ODBC Administrator in my computer, I sure that in another computer will be another DSN. Bu t I've already done with my problem. I got ODBC connection,using connection string. I understood my error. It's necessary after "DBQ=" in connection string to write path of folder, not of file.
-
I meant that, if i will create my DSN in ODBC Administrator in my computer, I sure that in another computer will be another DSN. Bu t I've already done with my problem. I got ODBC connection,using connection string. I understood my error. It's necessary after "DBQ=" in connection string to write path of folder, not of file.
Jackson86 wrote:
It's necessary after "DBQ=" in connection string to write path of folder, not of file.
That must be a dBase thing. I used the following for a DSN-less connection to an Access database:
"ODBC;Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\\somefolder\\dataaccess\\ADO\\nwind.mdb;"
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Jackson86 wrote:
It's necessary after "DBQ=" in connection string to write path of folder, not of file.
That must be a dBase thing. I used the following for a DSN-less connection to an Access database:
"ODBC;Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\\somefolder\\dataaccess\\ADO\\nwind.mdb;"
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb