Potential bug?

G

Guest

Hi,

Can somebody try this? Make a new .NET class library with one class.
Create a method that simply instantiates an instance of ADODB.Connection.
You will need to reference the ADODB assembly under .NET tab. Build the
project. Now make a vbscript file that creates an object of the class you
have just built. Then call the public method (which will attempt to
instantiate the ADODB.connection). If you have added a strong key and
registered the type library, and placed the assembly in the global assembly
cache all works fine. However, try moving the assembly to a computer without
visual studio (with a setup project) and see how you go.

I get a "File or Assembly name ADODB, or one of its dependencies was not
found". How bout you?
Jesse
 
N

Nick Malik [Microsoft]

install MDAC on the target computer

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
G

Guest

Hi Nick,

I have. First 2.6, 2.6 and now 2.8.

Did you try it and if so did it work?

Jesse
 
N

Nick Malik [Microsoft]

I've directly coded, or supervised, two dozen different projects that use
database connectivity. Never had the error you are discussing.

Tell me about the systems that you are using. What is the configuration of
your dev machine? your target machine?

(Especially your target machine: do you have any service packs installed?
Were there errors when installing the framework?)

Have you taking your target app and installed it anywhere else? If so, does
it fail there? If so, describe the config of that machine as well.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
G

Guest

The development machine has VS.NET 2003. It is running Windows 2000 with
SP4. I have MDAC 7.1 on it. The target machine is a Windows 2000 Server
with SP4 also. This originally had MDAC 2.6, so I tried it with 2.7 and now
2.8 - No luck. There were no problems installing the .NET Redistributable
Package on it. I have also got my brother to try it on his Windows XP Pro
machine which was a new installation so was likely to have any recent service
packs. In addition to installing the .NET framework on his computer, I got
him to install the SDK from the microsoft website - no go. On both target
machines, it is fine if the class is being called by a .NET app but not when
being called from VBscript with something like:

Dim conn
Set conn = CreateObject("MyAssembly.MyClass")
conn.method

It actually fails on the third line, indicating that object is created but
when the method is called the ADODB.Connection object cannot be instantiated.

I urge you to try one more time, I think you will be surprised to find that
it will not work. Obviously, it CAN work, as it does on the development
machine.

By the way,
Thanks for taking an interest.
and
Merry Christmas
 
N

Nick Malik [Microsoft]

OK. I got more info that time. I think I get the idea.

You are running your object from Windows Script Host, right?

What version of WSH are you running on the target environment?
[Normally, WSH 2.0 ships on Win2K. The current version is WSH 5.6. You can
download the newest version from:
http://msdn.microsoft.com/scripting ]

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
G

Guest

Yes, I beleive vbscript uses Windows Script Host, however I'm not 100% sure.
I installed the update for this as you suggested on my brothers XP machine
and also service pack 2. Still the same error.

Any other ideas?


Nick Malik said:
OK. I got more info that time. I think I get the idea.

You are running your object from Windows Script Host, right?

What version of WSH are you running on the target environment?
[Normally, WSH 2.0 ships on Win2K. The current version is WSH 5.6. You can
download the newest version from:
http://msdn.microsoft.com/scripting ]

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
Jessard said:
The development machine has VS.NET 2003. It is running Windows 2000 with
SP4. I have MDAC 7.1 on it. The target machine is a Windows 2000 Server
with SP4 also. This originally had MDAC 2.6, so I tried it with 2.7 and now
2.8 - No luck. There were no problems installing the .NET Redistributable
Package on it. I have also got my brother to try it on his Windows XP Pro
machine which was a new installation so was likely to have any recent service
packs. In addition to installing the .NET framework on his computer, I got
him to install the SDK from the microsoft website - no go. On both target
machines, it is fine if the class is being called by a .NET app but not when
being called from VBscript with something like:

Dim conn
Set conn = CreateObject("MyAssembly.MyClass")
conn.method

It actually fails on the third line, indicating that object is created but
when the method is called the ADODB.Connection object cannot be instantiated.

I urge you to try one more time, I think you will be surprised to find that
it will not work. Obviously, it CAN work, as it does on the development
machine.

By the way,
Thanks for taking an interest.
and
Merry Christmas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top