AtomicChip
Programmer
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 = "C:\\Projects\\Database\\DataTest.mdb";
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 "C:\Projects\Database\Debug\Database.dll" ()
Any ideas?
-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
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 = "C:\\Projects\\Database\\DataTest.mdb";
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 "C:\Projects\Database\Debug\Database.dll" ()
Any ideas?
-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy