Click to See Complete Forum and Search --> : Assertion when opening an ADO connection from VC++


Alvaro
April 2nd, 1999, 02:42 PM
I'm trying to open an ODBC data source using ADO from VC++ 6.0. Here's the code:

_COM_SMARTPTR_TYPEDEF(ADOConnection, IID_IADOConnection);

ADOConnectionPtr pConnection(CLSID_CADOConnection, NULL, CLSCTX_INPROC_SERVER);

HRESULT hr = pConnection->Open(_bstr_t("Provider=MSDASQL.1;Persist Security Info=False;User ID=alvaro;Data Source=OWLink"), _bstr_t(""), _bstr_t(""), 0);

Everything works fine up to the call to "Open" where I get a nasty Assertion box that says:

============================================
Debug Error!

File: i386\chkesp.c
Line: 42

The value of ESP was not properly saved accross a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
============================================

What's going on???

Also, where can I grab some good documentation on ADO programming using VC++?

Thanks in advance!

Alvaro

cbrenn
April 30th, 1999, 01:17 PM
Hi there !

Get your hands on Database programming with Visual C++ 6 in 21 days !

They talk alot about ADO and how to use it ! Very usefull !

indika
April 30th, 1999, 02:06 PM
Sounds like you are using a release version of a dll or exe with a debug virsion of your app.

Long shot.