Guest_imported
New member
- Jan 1, 1970
- 0
I'm trying to run a small program written in MSV C++ V6 on a Windows2000 machine with DB2 7. The database connection is not working with the 'CDaoDatabase' command, although it does connect to the db when we use 'CDatabase' instead of 'CDaoDatabase.' We need the 'CDaoDatabase' to work.
Does anyone have any ideas on this? See code piece and errors below.
Thanks
**********CODE**************
CString sConnect;
sArchiveConnect = "DSN=" + sDsn + ";UID=" + sUid + ";PWD=" + sPwd + ";";
sfLog.LogMessage(sConnect);
// Open the database
CDaoDatabase* pdbArchive;
pdbArchive = new CDaoDatabase;
try
{
pdbArchive->Open("", FALSE, TRUE, sArchiveConnect);
}
catch(CDaoException* e)
{
sf.LogMessage("Error opening the Archive Database."
;
THROW_LAST();
delete e;
return -1;
}
***********ERRORS*************************
SCODE_CODE = 340
SCODE_FACILITY = 4
SCODE_SEVERITY = 1
ResultFromScode = 80040154
m_pErrorInfo 0x0000000d
__vfptr CXX0030: Error: expression cannot be evaluated
m_lErrorCode CXX0030: Error: expression cannot be evaluated
m_nAfxDaoError -1017256565
m_scode 1532911360
Does anyone have any ideas on this? See code piece and errors below.
Thanks
**********CODE**************
CString sConnect;
sArchiveConnect = "DSN=" + sDsn + ";UID=" + sUid + ";PWD=" + sPwd + ";";
sfLog.LogMessage(sConnect);
// Open the database
CDaoDatabase* pdbArchive;
pdbArchive = new CDaoDatabase;
try
{
pdbArchive->Open("", FALSE, TRUE, sArchiveConnect);
}
catch(CDaoException* e)
{
sf.LogMessage("Error opening the Archive Database."
THROW_LAST();
delete e;
return -1;
}
***********ERRORS*************************
SCODE_CODE = 340
SCODE_FACILITY = 4
SCODE_SEVERITY = 1
ResultFromScode = 80040154
m_pErrorInfo 0x0000000d
__vfptr CXX0030: Error: expression cannot be evaluated
m_lErrorCode CXX0030: Error: expression cannot be evaluated
m_nAfxDaoError -1017256565
m_scode 1532911360