Link to home
Start Free TrialLog in
Avatar of Neal Hartman
Neal HartmanFlag for United States of America

asked on

Set RS = New Recodset

Dim Con As ADODB.Connection
Dim RS As ADODB.Recordset

Set Con = New ADODB.Connection
Set RS = New ADODB.Recordset

Works fine on my box but when I try installing on another box ( 2 so far ) I get "Run Time Error 430" "Class does not support..." when the code hits the last line above. I reinstalled, reinstalled Data Objects re-registered all the active-x dll's and ocx's.






Avatar of cdloves
cdloves

why dont you try this?

Dim con as new ADODB.Connection
Dim Rs as new ADODB.Connection

you dont have to use set statements, this could avoid the error.
Avatar of Neal Hartman

ASKER

Dim Cmd1 As Command

Con.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
    & App.Path & "\FTPxfer.mdb;Persist Security Info=False"

Con.Open

Set Cmd1 = New ADODB.Command

Cmd1.ActiveConnection = Con
Cmd1.CommandText = "SELECT * FROM Users"

Set RS = Cmd1.Execute()

Now I get a Run Time Error 13 - Type Mismatch on the last line above.
try executing your query using
rs.open method..
See if the same error persist..

sonal is right.  dont try to use "set" statements with ADO.

rs.open "select * from users",cn,2,2

where cn is your ADODB.Connection

hope this will help.

2,2 are constants of ADODB
I believe cdloves means
Dim con as new ADODB.Connection
Dim Rs as new ADODB.Recordset


Dear rmcquade:
I think that In your code only add the line indicated:

Dim Cmd1 As Command

Con.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
    & App.Path & "\FTPxfer.mdb;Persist Security Info=False"

Con.Open

Set Cmd1 = New ADODB.Command

Cmd1.ActiveConnection = Con
Cmd1.CommandText = "SELECT * FROM Users"
This line----------
cmd.CommandType =adCmdText
------------------------
Set RS = Cmd1.Execute()

No matter which way I do it I get either of the above Run Time Errors. These servers are also running Lotus Domino 5.0 (NT Server 4.0 SP5), would that affect it?


1. what are you coding : Standard EXE/ActiveX EXE/ActiveX DLL

2. Are you making a package for the other machines?

3. If your code is in an ActiveX component, what is the Compatibility of the Project? (see Project -> Properties)

If you provide the answers to these, then I may be able to help you ...

1. Standard EXE
2. Yes
3. N/A


I have got this to run on only one of four servers so far. The other three are about to get an "Order of Protection" out on me.
Not using the Set statement is nonsense. Using it is generally considered better (faster) practice, and even if you would use Dim As New you'd have the same error.

This sounds like a typical ADO Dll Hell problem. What version of VB and ADO are you using? And what service-packs? Make sure these are updated.

Also, the one machine it works on, is that your development box? What's difference between that one and the other ones? (Are all boxes NT?)

You say "I reinstalled, reinstalled Data Objects". It seems wise to me to do this the other way around (first MDAC, since this is your dependency, then your app). Did you get errors when (re)installing, or only on running the App?

Don't know about Lotus Domino. Do you have a test-box? Try installing on a clean NT Server.
I think you on the right track about the DLL's. I downloaded a Comapnant Checker from Microsoft. It says I'm running version 2.5 of the Data Access Componants. The machine I just installed it on is running version 2.1.xxxxx the latest available from on Microsofts MDAC download page. I can't figure out how I got 2.5.
That was it. I recompiled using ver 2.1 and it works fine. Jeremy, answer the question and I will send you the points.
 
ASKER CERTIFIED SOLUTION
Avatar of Jeremy_D
Jeremy_D

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial