Click here to Skip to main content
16,016,024 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++ Daimond Problem Pin
ThatsAlok25-May-08 22:50
ThatsAlok25-May-08 22:50 
Questionmoving from on dialog box to the other Pin
lahom25-May-08 9:40
lahom25-May-08 9:40 
AnswerRe: moving from on dialog box to the other Pin
Nelek25-May-08 11:07
protectorNelek25-May-08 11:07 
GeneralRe: moving from on dialog box to the other Pin
lahom25-May-08 11:27
lahom25-May-08 11:27 
GeneralRe: moving from on dialog box to the other Pin
Nelek25-May-08 11:40
protectorNelek25-May-08 11:40 
GeneralRe: moving from on dialog box to the other Pin
lahom25-May-08 11:52
lahom25-May-08 11:52 
GeneralRe: moving from on dialog box to the other Pin
Nelek25-May-08 12:28
protectorNelek25-May-08 12:28 
QuestionSOLVED CDatabase connection fails with different directory path. [modified] Pin
Vaclav_25-May-08 4:49
Vaclav_25-May-08 4:49 
Trying to connect (Open) to database with connection string retrieved using GetConnect.
I get an error message telling me that the Open failed, but the file path is different than the one I sent in Open function.
My application and database are in different subdirectories and it should not be a problem.
Could this be an ODBC problem? Perhaps I need new ODBC driver version?

I am running VC6.0 with Access 2000 and no, upgrading to anything else is not an option. Please refrain from comments like that.



Here is the code snippet:

// build database
m_CFD2008Doc->m_pFDDatabase = new CDatabase();
VERIFY(m_CFD2008Doc->m_pFDDatabase );

// set connect string
CString strConnect =
"ODBC;DSN=MS Access Database;DBQ=K:\0 FD2008\Database\db2.mdb;DefaultDir=K:\0 FD2008\Database;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;";

if(! m_CFD2008Doc->m_pFDDatabase->Open(NULL,FALSE,FALSE, strConnect,TRUE ))
{
TRACE(" Failed to open %s database ", strConnect);
}

Error message received:
Could not find file "K:\0 FD2008\V1\FD2008\.mdb"

Thanks for your help
Vaclav

PS Why is this editor having problem accepting dereference symbol "->" in text?



A dummy fell for the oldest trick in C not including double \\ in the string. Also the last parameter in Open must be FALSE.

<div class="ForumMod">modified on Sunday, May 25, 2008 12:48 PM</div>
QuestionRe: CDatabase connection fails with different directory path. Pin
bob1697225-May-08 6:35
bob1697225-May-08 6:35 
AnswerRe: CDatabase connection fails with different directory path. Pin
Vaclav_25-May-08 6:43
Vaclav_25-May-08 6:43 
QuestionRe: CDatabase connection fails with different directory path. Pin
bob1697225-May-08 9:35
bob1697225-May-08 9:35 
AnswerRe: CDatabase connection fails with different directory path. Pin
Vaclav_25-May-08 11:13
Vaclav_25-May-08 11:13 
GeneralRe: CDatabase connection fails with different directory path. Pin
bob1697225-May-08 15:30
bob1697225-May-08 15:30 
GeneralRe: CDatabase connection fails with different directory path. Pin
Vaclav_25-May-08 15:43
Vaclav_25-May-08 15:43 
GeneralRe: CDatabase connection fails with different directory path. Pin
bob1697225-May-08 15:37
bob1697225-May-08 15:37 
GeneralRe: CDatabase connection fails with different directory path. Pin
Vaclav_25-May-08 15:44
Vaclav_25-May-08 15:44 
GeneralRe: CDatabase connection fails with different directory path. Pin
bob1697225-May-08 16:45
bob1697225-May-08 16:45 
GeneralRe: CDatabase connection fails with different directory path. Pin
Vaclav_25-May-08 15:46
Vaclav_25-May-08 15:46 
QuestionRe: CDatabase connection fails with different directory path. Pin
bob1697225-May-08 16:47
bob1697225-May-08 16:47 
GeneralRe: CDatabase connection fails with different directory path. Pin
bob1697225-May-08 15:43
bob1697225-May-08 15:43 
GeneralRe: CDatabase connection fails with different directory path. Pin
Vaclav_26-May-08 4:06
Vaclav_26-May-08 4:06 
GeneralRe: CDatabase connection fails with different directory path. Pin
bob1697226-May-08 4:20
bob1697226-May-08 4:20 
GeneralCHANGED SUBJECT - Now quest for invalid descriptor index !! Pin
Vaclav_26-May-08 7:22
Vaclav_26-May-08 7:22 
GeneralRe: CHANGED SUBJECT - Now quest for invalid descriptor index !! Pin
Vaclav_27-May-08 8:16
Vaclav_27-May-08 8:16 
QuestionSetting Windows Environment Variables programmatically (win32/mfc) [modified] Pin
Manu.Dev25-May-08 2:24
Manu.Dev25-May-08 2:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.