Using ADODB in a Form

G

Guest

I have 2 computers (one with VS NET 1.1 and one with Framework 1.1 only)
I have an application with a single form and a single line of user code.
The line of code is:

Dim adoConn As New ADODB.Connection

In references, I have a reference to: C:\Program Files\Microsoft.NET\Primary Interop Assemblies\ADODB.dll

When I execute the WinApp1.exe on the computer VS Net, the form opens as expected. When I copy the exe file to the computer with only Framework and attempt to launch the exe, I get an error that begins with:
"Application has generated an exception...".

I thought for simple applications all you needed was to copy the exe to a computer with Framework. Where am I going wrong.
 
K

Ken Tucker [MVP]

Hi,

Copy all the files in the bin directory of the directory your project
is located in.

Ken
----------------
 
G

Guest

I begin a new Windows Form project. I add the reference as stated earlier. I add the line of code to the form as stated earlier. Upon compilation, the Bin folder contains one file, the exe. When I copy the exe to the computer with Framework 1.1 only, I get the error. If I remark out the line of code, the empty form opens as expected on the computer with Framework 1.1.

In summary, I (1) create a new project, (2) Add reference to C:\Program Files\Microsoft.NET\Primary Interop Assemblies\ADODB.dll, (3) add the following line of code to form1: Dim adoConn As New ADODB.Connection, (4) compile in Release configuration, (5) copy single file (.exe) to computer with Framework 1.1, (6) launch the .exe from computer with Framework 1.1. I get an error.

If I remark out the line in Step #3, and repeat steps 4, 5 and 6, the form opens fine. Can someone confirm this behavior.
 
G

Guest

There is only one file in the Bin. Here is what I did:

(1) Open new Windows Application project; (2) Add reference for C:\Program Files\Microsoft.NET\Primary Interop Assemblies\ADODB.dll; (3) Add line of code: Dim adoConn As New ADODB.Connection to Declarations section of Form1.vb; (4) Compile in Release configuration; (4) Copy single file (.exe) from development computer to a laptop that only contains Framework 1.1; (5) launch the .exe on laptop. At this point I get "Application has generated...." error.

If I remark out the line of code in step #3 and repeat steps 4, 5, and 6, the form opens fine on the laptop. Can someone confirm this behavior or advise me about what I am doing wrong.
 
G

Guest

There is only one file in the Bin. Here is what I did:

(1) Open new Windows Application project; (2) Add reference for C:\Program Files\Microsoft.NET\Primary Interop Assemblies\ADODB.dll; (3) Add line of code: Dim adoConn As New ADODB.Connection to Declarations section of Form1.vb; (4) Compile in Release configuration; (4) Copy single file (.exe) from development computer to a laptop that only contains Framework 1.1; (5) launch the .exe on laptop. At this point I get "Application has generated...." error.

If I remark out the line of code in step #3 and repeat steps 4, 5, and 6, the form opens fine on the laptop. Can someone confirm this behavior or advise me about what I am doing wrong.
 
G

Guest

Problem is solved. I needed to copy the ADODB.DLL to the laptop and place it in the same folder as the exe. I guess I thought that the .DLL would have been part of the installation of Framework 1.1 on the laptop. It is not.
 

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