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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.DLL help

Status
Not open for further replies.

AtomicChip

Programmer
May 15, 2001
622
CA
Here's the problem:

I'm trying to create a database from scratch with a C++ DLL through VB6 with a DAO connection. The program creates the database itself without a problem, but when I close the VB6 app (not right after database creation), I get an error saying:

Debug Assertion Failed!

Program: VB6.exe
File: daocore.cpp
Line: 42
...

The code that I have for the DLL is as follows:

#include <afxdao.h>
#include <afx.h>
#include <windows.h>
#include <stdio.h>
#define NOMANGLE

NOMANGLE void _stdcall CreateDatabase() {

CDaoDatabase daodb;
CString szdbPath = &quot;C:\\Projects\\Database\\DataTest.mdb&quot;;
try
{
daodb.Create(szdbPath,dbLangGeneral);
}
catch ( CException* e)
{
e->ReportError();
e->Delete();
}

}

The declaration for the function in the VB6 app is as follows:

Public Declare Sub CreateDatabase Lib &quot;C:\Projects\Database\Debug\Database.dll&quot; ()

Any ideas?

-----------------------------------------------
&quot;The night sky over the planet Krikkit is the least interesting sight in the entire universe.&quot;
-Hitch Hiker's Guide To The Galaxy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top