Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error message when connecting to SQL server 1

Status
Not open for further replies.

joebickley

Programmer
Joined
Aug 28, 2001
Messages
139
Location
GB
HI

I have the following code to connect to a SQL server and just put 1 figure in a box on a form. This works great on my pc but when i turn it into an exe and pass it to my colleague it does not work on his machine. the error is:

Class doesn't support Automation (Error 430)

All the security and things are ok Any ideas??

Code:
sConn = "DRIVER=SQL Server;server=solihullweb;uid=sa;pwd=soldata;database=rcs_data"

Set cnn = New ADODB.Connection
cnn.ConnectionTimeout = 15
cnn.ConnectionString = sConn
cnn.Open

 Dim csql As String
  Dim rs As New ADODB.Recordset
    csql = "select [6figvin] from tblvehicledetails"
    rs.Open csql, cnn, adOpenStatic, adLockOptimistic
    Text1 = rs![6figvin]
    rs.Close
Office automation specialist
Land Rover UK
 
Seeing your signature, I'm sure you have but I thought I'd just check that you are using some form of packaging software? But I may well be wrong??

It sounds like a DLL you have refrenced to has not been included with the exe you have compiled.

elziko
 
Joe -

You need to make sure your colleague has the latest MDAC installed on his machine. Go to the MSDN section on Microsoft's web site and search on MDAC_TYP.EXE to download it.

Chip H.
 
I thought that having the latest MDAC would be the issue!

However there is one problem. Where i work all of the PCs are locked down so you cant install anything and if anything is to be added to the default package it take weeks of the usual crap with our systems department to get it put through and it aint worth it.

Is it not posible to package the relevant Dlls within the EXE?

Other wise its back to good old MS access and all the crap that comes with it if you know what i mean.

Thanks
 
This is the infamous "binary compatibility" myth. The problem you are having is caused by having a reference to a newer/different version of ADO. Make sure that in your project->references check the version of ADO you have a reference to. Then do as chiph recommended and install MDAC_TYP.EXE.
 
Doing a hand-install of MDAC is not for the faint of heart. <shudder>

Best thing would be to do like Recurse suggested and change the reference in your program to be the same as what's installed on your colleague's machine. And in the meantime put the screws to the IT department to get the MDAC updated.

Chip H.
 
thanks mate will have another go

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top