B
Burton Wilkins
Dear Brandon:
You sent me some advice before as to how get the DataLink working, but I haven't been able to get your solution to compile:
You sent me this:
Here are my issues. First you suggest that I use "#using <MSDASC.dll>. When I use
this I get the error "Fatal error C1107: could not find assembly "MSDASC.dll"; please
specify the assembly search path using /AI or by setting the LIBPATH environment
variable.
The fact is, there appears to be no such DLL as MSDASC.dll. When I copy in your code
exactly as you sent it to me, then on the Solution Explorer I go to References, and add a
reference on the COM tab to the "Microsoft OLE DB Service Component 1.0 Type Library"
whose source is "C:\Program Files\Common Files\System\OLE DB\oledb32.dll", not
"MSDASC.DLL". The reference that appears then on the Solution Explorer Reference is in
fact MSDASC, but then when I look up the Properties Page for this reference I find that
the "Output Name" is $(OutDir)\Interop.MSDASC.dll.
So the only way I can use "MSDASC.dll" in a using statement is as:
#using <Interop.MSDASC.dll>, not <MSDASC.dll> as you suggested. Now, is this OK
or am I missing a MSDASC.dll on my computer to reference.
Having used "Interop.MSDASC.dll" in the using statement, as in the following code:
#include "stdafx.h"
#using <mscorlib.dll>
#using <C:\Program Files\Microsoft.Net\Primary Interop Assemblies\adodb.dll>
#using <Interop.MSDASC.dll> //C:\Program Files\Common Files\System\OLE DB\oledb32.dll
using namespace System;
int _tmain()
{
ADODB::Connection* cn;
MSDASC:
ataLinks* dataLink = new MSDASC:
ataLinksClass();
cn = __try_cast<ADODB::Connection*>(dataLink->PromptNew());
}
When I then compile my code I get these errors:
Error C2061: Syntax error: Identifies "DataLinksClass".
Error C2065: "datalink": undeclared identifier.
Error C2065: "DataLiniks": Undeclared idnetifies
Error C2227: left of '->PromptNew/' must point to class/struct/union type is"unknown-type"
Error C2653: "MSDASC": is not a class or namespace name
Error C2653: "MSDASC": is not a class or namespace name.
Error C3861: "dataLink": Identifies not found, ven with argument-dependent lookup.
You say that this code compiles for you. Well it certainly isn't compiling for me. I'm using .Net C++,
version 1.1. Is that what you are using?
The only way I can use "MSDASC.dll" in a using statement is as:
#using <Interop.MSDASC.dll>, not <MSDASC.dll> as you suggested. Now, is this OK
or am I missing a MSDASC.dll on my computer to reference? The "Oledb32.dll" from MSDASC is a
part of is version 2.70.9001.0. Is this DLL the proper version?
Sincerely,
Burton G. Wilkins
You sent me some advice before as to how get the DataLink working, but I haven't been able to get your solution to compile:
You sent me this:
Hi Burton, I was able to get the following code to compile:
You then went on to advise the use of "Ildasm", but honestly I couldn't get that to work.#using <mscorlib.dll>
#using <adodb.dll>
#using <MSDASC.dll>
int main()
{
ADODB::Connection* cn;
MSDASC:ataLinks* dataLink = new MSDASC:
ataLinksClass();
cn = __try_cast<ADODB::Connection*>(dataLink->PromptNew());
}
The problem was likely with "DataLinks" vs "DataLinksClass".
Here are my issues. First you suggest that I use "#using <MSDASC.dll>. When I use
this I get the error "Fatal error C1107: could not find assembly "MSDASC.dll"; please
specify the assembly search path using /AI or by setting the LIBPATH environment
variable.
The fact is, there appears to be no such DLL as MSDASC.dll. When I copy in your code
exactly as you sent it to me, then on the Solution Explorer I go to References, and add a
reference on the COM tab to the "Microsoft OLE DB Service Component 1.0 Type Library"
whose source is "C:\Program Files\Common Files\System\OLE DB\oledb32.dll", not
"MSDASC.DLL". The reference that appears then on the Solution Explorer Reference is in
fact MSDASC, but then when I look up the Properties Page for this reference I find that
the "Output Name" is $(OutDir)\Interop.MSDASC.dll.
So the only way I can use "MSDASC.dll" in a using statement is as:
#using <Interop.MSDASC.dll>, not <MSDASC.dll> as you suggested. Now, is this OK
or am I missing a MSDASC.dll on my computer to reference.
Having used "Interop.MSDASC.dll" in the using statement, as in the following code:
#include "stdafx.h"
#using <mscorlib.dll>
#using <C:\Program Files\Microsoft.Net\Primary Interop Assemblies\adodb.dll>
#using <Interop.MSDASC.dll> //C:\Program Files\Common Files\System\OLE DB\oledb32.dll
using namespace System;
int _tmain()
{
ADODB::Connection* cn;
MSDASC:
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
cn = __try_cast<ADODB::Connection*>(dataLink->PromptNew());
}
When I then compile my code I get these errors:
Error C2061: Syntax error: Identifies "DataLinksClass".
Error C2065: "datalink": undeclared identifier.
Error C2065: "DataLiniks": Undeclared idnetifies
Error C2227: left of '->PromptNew/' must point to class/struct/union type is"unknown-type"
Error C2653: "MSDASC": is not a class or namespace name
Error C2653: "MSDASC": is not a class or namespace name.
Error C3861: "dataLink": Identifies not found, ven with argument-dependent lookup.
You say that this code compiles for you. Well it certainly isn't compiling for me. I'm using .Net C++,
version 1.1. Is that what you are using?
The only way I can use "MSDASC.dll" in a using statement is as:
#using <Interop.MSDASC.dll>, not <MSDASC.dll> as you suggested. Now, is this OK
or am I missing a MSDASC.dll on my computer to reference? The "Oledb32.dll" from MSDASC is a
part of is version 2.70.9001.0. Is this DLL the proper version?
Sincerely,
Burton G. Wilkins