ODBC access via MFC

I have a problem calling Open method within CRecordset class. Did everything just as MSDN said. The code is simple:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <afxdb.h>

using namespace std;

int main()
{
	CDatabase *FirstDB = new CDatabase;
	FirstDB->OpenEx(_T(""), 0);
	CRecordset rsFirst(FirstDB);
	rsFirst.Open();
	FirstDB->Close();
	return 0;
}


In the second line (FirstDB->OpenEx(_T(""), 0);) I'm choosing the data source manually. I have created a few data sources one of which is Microsoft Access managed txt file, and the other two .accdb files filld some tables, validated them using ODBC Administrator.
The programme crashes at line rsFirst.Open(); with some mysterious unhandled exception.

Would be grateful for any help.
Why is the exception mysterious?
Topic archived. No new replies allowed.