How do I call MSDASC::DataLinks::PromptNew() undr .Net C++

  • Thread starter Thread starter Burton Wilkins
  • Start date Start date
B

Burton Wilkins

Gentleman:

I'm trying to get the DataLink to work under C++, and I need help. I'm able to make it work under VB and C#, but not C++. Under C# (with references to "adodb", and "MSDASC") , I would accomplish this by the following code:

ADODB._Connection cn; //Define ADO Connection.

MSDASC.DataLinks dataLink = new MSDASC.DataLinks():
cn = (ADODB._Connection) dataLink.PromptNew();

Under C++, I would expect some like this:

#using <adodb.dll> //Both using had to be "Resolve #using References" under the Property Pages C/C++.
#using <Interop.MSDASC.dll> //... because MSDASC alone fails, even though I resolved under the Property Pages.

ADODB::Connection* cn; //This line compiles OK, so long as the resolves have been done.

MSDASC::DataLinks* dataLink = new MSDASC::DataLinks(); //FAILS:Error C2061:Syntax error: identifier DataLinks
cn = (ADODB::Connection) dataLink->PromptNew() //Can't get this far because the previous line fails. I'm just guessing at this point.

I go to MSDN, and there is no definition for Error C2061, so I am faces with a mystery. I realize that this is Unmanage code, but certain there must be a way to call up the DataLink from .Net C++. Would someone please advise how I can get around this problem.

Sincerely,

Burton G. Wilkins, Programmer.

P.S: The libraries I am using are these:
MSDASC = c:\Program Files\Word\Samples\C++\AccessMaintenance\Debug\Interop.MSDASC.dll Microsoft OLE DB Service Component 1.0 Type Library
ADODB = C:\Program Files\Microsoft.NET\Primary Interop Assemblies\adodb.dll
 
Back
Top