• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4430
  • Last Modified:

Runtime error 430 in VB6 sp6

I have a compiled exe that produces runtime error 430 - Class does not support Automation or does not support expected interface.  The program runs fine under Windows 7, but produces this error under Windows XP sp3.  

The line causing the error is "set cn = adodb.connection".  The binding is set at the top of the module as "Public cn As ADODB.Connection" The older version runs fine under both. I believe I have all the references set correctly, but I have a new hard drive and had to reinstall everything. Any ideas or suggestions would be greatly appreciated.  I can provide any additional information as needed.
0
tbs_mnp
Asked:
tbs_mnp
  • 9
  • 5
  • 5
  • +1
5 Solutions
 
GrahamSkanCommented:
You are using early binding, so there is a chance that you have specified a later version of the Microsoft Active Data Objects library than is available on the XP system.

You can usually get away later versions than are used in the compilation.

I suggest that you use late binding. I.e. do not reference the library at all and declare all the objects as Object types.
0
 
tbs_mnpAuthor Commented:
I'm not sure how involved that would be to change the delarations.  But the XP system is running 2.8, I tried specifying 2.7 and 2.5 in the Reference list in the project which didn't make a difference.  Forgive my ignorance, but what would be the best way to change the cn as adodb.connection to the proper object type?
0
 
kbireckiCommented:
I'm wondering if you have any ado on the xp system at all.  Can you try to install the latest mdac and try your program again.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
tbs_mnpAuthor Commented:
When I tried to install the latest MDAC it said it couldn't install.  So I ran the component checker and shows MDAC 2.8 SP1 ON WINDOWS XP SP3.  
0
 
GrahamSkanCommented:
Actually, that line doesn't look right.

This is what I would use:


Dim cn As ADODB.Connection
Set cn = CreateObject("Adodb.Connection")
0
 
GrahamSkanCommented:
or

Dim cn As New ADODB.Connection
cn.Open strConnectionString
0
 
tbs_mnpAuthor Commented:
@ Graham Skan, made it further, I used

Dim cn as new adodb.connection

pconn = Connection String

cn.open pconn

But then on the cn.open I'm still getting the error 430???
0
 
kbireckiCommented:
I don't know if out would make a difference, but I setup my connections like this:
Dim cn as adodb.connection
Set cn = new adodb.connectionn

"new" is in the set statement instead of the dim stmt.  If that doesn't make a difference, I'd try a simple connection to another db, something local and basic.  Maybe even using a preconfigured odbc dsn.
0
 
tbs_mnpAuthor Commented:
my apologies to kbirecki, that was a type caused by fast typing from memory, my original code is in fact   Set cn = New ADODB.Connection, the binding was Public cn As ADODB.Connection.  Sorry about that.  I appreciate you noticing though.  I was hoping this would be something simple that I was overlooking, but I'm just not seeing it.  Maybe this will help. My connection string is:

   pConn = "PROVIDER=SQLOLEDB;Server=servername;Uid=user;Pwd=password;Database=DB" and I seem to be getting the 430 error on that now when I use it with the cn.open. I did confirm the sqloledb.dll file is on the XP machine.
 
0
 
ArkCommented:
This is definitely MDAC versions difference. Old MDAC versions doesn't allow include provider into connection string. Assign dataprovider via property.
Set oConn = New ADODB.Connection
   With oConn
     .Provider = "SQLOLEDB"
     .CursorLocation = adUseServer
'     .CursorLocation = adUseClient
     .mode = adModeShareDenyNone
     .open "Server=servername;Uid=user;Pwd=password;Database=DB"
   End With
'If you'r using MDAC 2.0 you have to define ALL connection string parameters as properties:
   With oConn
     .Provider = sProvider
     .Properties("Data Source").value = sPath
     .Properties("User").value = sUserName
     .Properties("Password").value = sPassword
     .Properties("Jet OLEDB:Engine Type") = 5
     .CursorLocation = adUseServer
     .mode = adModeShareDenyNone
     .open 'NO CONNECTION STRING AT ALL
   End With

Open in new window

0
 
tbs_mnpAuthor Commented:
I will give this coding a try, but my question is where is the difference.  Is compiling under Windows 7 then running in XP causing the confilict?  Is there a difference between the 2.8 MDAC on XP compared to the version running under Windows 7?  I'm just trying to understand this.  I restored my VM system running XP and I was able to get the application up and running.  I just wanted to get away from the Virtual Machine if possible, and do the updates in Win 7, but I wanted to understand the differences.
0
 
GrahamSkanCommented:
It works OK for me with VB6 (No service packs), Window7 (64bit) and ADO 2.8.

There may be something wrong with your Win 7 system.

Does intellisense pop up the list of class members when you type 'cn.' ?
0
 
tbs_mnpAuthor Commented:
Yes it does.  I get a full listing for the CN declaration.
0
 
GrahamSkanCommented:
Do you have any more ADO libraries? I have several on mine. I'm pretty sure that they are all the same on this method, so it might be worth specifying an earlier one to see what happens.
0
 
tbs_mnpAuthor Commented:
I tried 2.5, 2.6, 2.7 and 2.8.  None of which cooperated.  I don't want to use up much more of all of your (all respondents) time.  I really appreciate all your efforts.  I know it is probably something small and dumb I am missing, but I just haven't been able to figure it out.  I really appreciate all of your assistance, and quick responses.
0
 
kbireckiCommented:
I don't recall about suggesting this, but did you try installing vb6 on both  platforms and separately compiling two versions?  Verify the app compiled on one platform works on that platform and then try swapping the complied versions and see which had a problem.  Maybe that would shed some light on something.
0
 
ArkCommented:
This error will fire both in IDE and when compiled . Problem is NOT in ADO version (ADO is just an ActiveX wrapper - .tlb prior to 2.8 and ActiveX dll for 2.8 for MDAC componente - OLEDB,ODBC etc). So the problem is in MDAC version (in your case in OLEDB version). If you can successfully install SAME MDAC versions on win95 and win7 - you'll get same results (though there will be some problems with ADO.Net and 64-bit processors)
0
 
tbs_mnpAuthor Commented:
For Ark, what is the best way to confirm the version of MDAC then?  I used ComponentChecker and is showed 2.8 was installed in the WinXP version but doesn't run under Win7.  I was able to successfully run the application on multiple Windows 7 workstations, but it would produce the error on a couple of WinXP workstations.  Once I recreated the P&D package using WinXP on my development machine, I was able to install it on the XP workstations and it ran like a charm?  That is my confusion as I don't know what to look at as I can't tell what changed between compiling in Win7 and running on XP.  

Per an above posted question,

Compiled in Win7, runs on Win 7, but not XP
Compiled in XP runs on Win 7 and XP
0
 
ArkCommented:
Private Sub Command1_Click()
   Dim mdacVer As Object
   Set mdacVer = CreateObject("MDACVer.Version")
   MsgBox mdacVer.String
End Sub
0
 
ArkCommented:
PS
Not 100% sure but AFAIK all modern machines (since win98SE) have at least MDAC 2.1. So, for version independent code
 
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
conn.Provider=strProvide
conn.xxx=strXXX
conn.Open

Open in new window

Also, check services enabled for SQLOLEDB
HKEY_CLASSES_ROOT\CLSID\{0C7FF16C-38E3-11d0-97AB-00C04FC2AD98}
See
http://support.microsoft.com/kb/245267
http://blogs.msdn.com/b/selvar/archive/2007/11/10/ole-db-resource-pooling.aspx
0
 
tbs_mnpAuthor Commented:
I unfortunately haven't been able to solve this problem at this point.  An I've been pulled onto a major project taking up 100% of my time so I didn't this to linger  I wanted to thank all of those who offered possible solutions.  The answers were quick and very concise and detailed, and I really appreciate everyone's efforts on this topic.  Thank you all agan.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 9
  • 5
  • 5
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now