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

C++ and ODBC connection help ...

Status
Not open for further replies.

s0hel

Programmer
Jul 15, 2004
8
0
0
US
//ADO import
#import "c:\Program Files\Common Files\System\ADO\msado15.dll" no_namespace rename("EOF", "EndOfFile")
#import <msrdo20.dll> no_namespace rename( "EOF", "_EOF" ) rename("UserNameA", "_UserNameA")

void dbConnect()
{
_ConnectionPtr m_ADOConn;
m_ADOConn = NULL;
m_ADOConn.CreateInstance( __uuidof( Connection ) );
// still null... i dont know why

m_ADOConn->ConnectionString = strCon;
// program crashes on this line ...

m_ADOConn->Provider = "MSDASQL";
m_ADOConn->CursorLocation = adUseClient;
}

can anyone explain to me what I'm doing wrong ? I imported the msado15.dll for _ConnectionPtr ... this is really bugging me, I dont know what to do
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top