473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Could I have some help wiht the DataLink: Brandon Bray

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:
Hi Burton, I was able to get the following code to compile: #using <mscorlib.dll>
#using <adodb.dll>
#using <MSDASC.dll>

int main()
{
ADODB::Connection* cn;
MSDASC::DataLinks* dataLink = new MSDASC::DataLinksClass();

cn = __try_cast<ADODB::Connection*>(dataLink->PromptNew());
}

The problem was likely with "DataLinks" vs "DataLinksClass".

You then went on to advise the use of "Ildasm", but honestly I couldn't get that to work.

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::DataLinks* dataLink = new MSDASC::DataLinksClass();
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

Nov 16 '05 #1
1 3577
Burton Wilkins wrote:
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:
Hi Burton,
I'm sorry that I did not see this sooner. Hopefully, you haven't been
completely blocked waiting for some help. :-)
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.
Using "Interop.MSDASC.dll" is just fine. You just went about creating the
assembly in a different way than I did. I used the tlbimp tool on the
command-line, and you used the IDE to create the assembly from the
oledb32.dll type library. This shouldn't have any significant impact on the
result, other than the types may be in different namespaces.
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?


Try using the type "Interop::MSDASC::DataLinksClass". I bet the assembly was
generated such that everything was put in the Interop namespace.

Just to be sure, I would try opening "Interop.MSDASC.dll" in ildasm. If you
open the "Visual Studio Command Prompt" (it's on the start menu where Visual
Studio is), choose Open from the File menu. There, search for the assembly
"Interop.MSDASC.dll" and open it. This will give you a look inside that
assembly to see how it is structured.

I hope that helps get you going. Cheerio!

--
Brandon Bray Visual C++ Compiler
This posting is provided AS IS with no warranties, and confers no rights.
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
4
by: Brandon J. Van Every | last post by:
Ok, I've played the posting game until 2 am. It was a good run instead of playing something mindless like Diablo II again. Thats said, I could have finished "Childhood's End" instead. Tangible...
0
by: ElmoWatson | last post by:
I'm trying to use the Windows DataLink (udl) to set up a connection to a MySQL database. I've installed the 3.51 ODBC driver from the MySQL website - however, using a DataLink, it doesn't show...
14
by: Brandon Hoppe | last post by:
I'm trying to change the src of an ilayer in the parent document from a link inside the ilayer. I'm not able to get it to work. All that happens is Netscape 4 crashes. This is for Netscape 4 only....
0
by: Jay Douglas | last post by:
Hello, I'm trying to create a Data Links Property window that behaves just like the dialog box in Visual Studio .Net for MS Sql Server connections. I've found a lot of examples that use...
1
by: Burton Wilkins | last post by:
Dear Associaties: I asked this question last Friday, and here it is Wednesday and NOBODY has replied. Come on. Help a little. All that I am looking for is 2 lines of code. One of you must...
10
by: bmlclemson08 | last post by:
I'm trying to figure out why this program is not printing out the correct mode... suggestions? int main(){ int qty, num, mode, a_1, a_2, sum = 0; float mean; int max_qty = 0; printf ("Enter...
5
by: Anshu | last post by:
int a; for(int i=0;;i++) {cin>>a; if(a==0) break; for(int j=0;j<i;j++) //NEW SORT MECHANISM if(a<a) {int t=a;a=a;a=t;} }
111
by: Enteng | last post by:
Hi I'm thinking about learning C as my first programming language. Would you recommend it? Also how do you suggest that I learn it?What books/tutorials should I read for someone like me? Thanks...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.