Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDatabase works - CDaoDatabase doesn't - help

Status
Not open for further replies.

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
 
pdbArchive->Open("DSN string here; driver={};uid=....", FALSE, TRUE, sArchiveConnect);
John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top