[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Set RS = New Recodset

Posted on 2000-01-14
13
Medium Priority
?
168 Views
Last Modified: 2010-05-02
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.






0
Comment
Question by:Neal Hartman
  • 5
  • 2
  • 2
  • +4
13 Comments
 

Expert Comment

by:cdloves
ID: 2354295
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.
0
 
LVL 1

Author Comment

by:Neal Hartman
ID: 2354315
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.
0
 

Expert Comment

by:Sonal
ID: 2354353
try executing your query using
rs.open method..
See if the same error persist..

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

Expert Comment

by:cdloves
ID: 2354373
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
0
 

Expert Comment

by:paulchou
ID: 2354637
I believe cdloves means
Dim con as new ADODB.Connection
Dim Rs as new ADODB.Recordset


0
 

Expert Comment

by:gonzo031
ID: 2354729
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()

0
 
LVL 1

Author Comment

by:Neal Hartman
ID: 2355898
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?

0
 
LVL 1

Expert Comment

by:Vin32
ID: 2359222

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 ...

0
 
LVL 1

Author Comment

by:Neal Hartman
ID: 2359295
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.
0
 
LVL 4

Expert Comment

by:Jeremy_D
ID: 2359744
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.
0
 
LVL 1

Author Comment

by:Neal Hartman
ID: 2360102
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.
0
 
LVL 1

Author Comment

by:Neal Hartman
ID: 2360278
That was it. I recompiled using ver 2.1 and it works fine. Jeremy, answer the question and I will send you the points.
 
0
 
LVL 4

Accepted Solution

by:
Jeremy_D earned 300 total points
ID: 2361963
OK, rmcquade, here's the answer again for completeness. BTW, you should be able to grade a comment as an answer.

---------------------------------------
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.
 
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question