Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

adoConnection.Execute  -  easy question

Posted on 2002-07-05
3
Medium Priority
?
205 Views
Last Modified: 2012-06-27
Hello,

Dim TempRS As Recordset
Set TempRS = DataEnvironment1.Connection1.Execute("SELECT * FROM Students")

"Students" is a table.
I get the following error: "Type mismatch"
Why doesn't it work?
0
Comment
Question by:slavikn2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
PNJ earned 200 total points
ID: 7132363
Assuming you've opened the connection correctly, then try:

   Dim RS as ADODB.RecordSet
   
   SQL = "SELECT * FROM STUDENTS"
   Set RS = New ADODB.RecordSet
   RS.Open SQL, Connection1, adOpenForwardOnly
0
 
LVL 3

Expert Comment

by:PNJ
ID: 7132365
sorry, add

   Dim SQL As String
0
 

Author Comment

by:slavikn2
ID: 7132400
That was enough:

Dim TempRS As ADODB.Recordset
Set TempRS = DataEnvironment1.Connection1.Execute("SELECT * FROM Students")
0

Featured Post

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.

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

661 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