Solved

Connecting Access to Mysql for recordset using ADO

Posted on 2013-06-21
3
808 Views
Last Modified: 2013-06-21
I am converting a database from using a MSSQL back end to a MySQL backend (first time) and am having trouble getting the ADO connection for a recordset to work. For the Access front end to MSSQL backend I am using this code:

    Dim rsItems As New ADODB.Recordset
    Dim conn As New Connection
    Set conn = New ADODB.Connection

    conn.Open "DSN=LP"
    SQL = "Select * From [Items Check] Where [Order Number]=" + Format$(Me![Order Number])
    rsItems.Open SQL, conn, adOpenStatic, adLockOptimistic
    
    If Not rsItems.EOF Then rsItems.MoveFirst
    
    Do Until rsItems.EOF

Open in new window


The code above works fine in that configuration, but when running it against MySQL it fails.

The first error is line 2, invalid use of new keyword. Removing the word "new" gets a little further to line 5 where I get method or data member not found.

 I have tried several variations but they all give errors and I am unable to fine a set of commands that replace these for MySQL.

Any pointers very much appreciated.
0
Comment
Question by:AMPLECOMPUTERS
[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 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 39266068
I believe all you need (8 methods) is found here http://msdn.microsoft.com/en-us/library/ms807027.aspx
0
 

Author Closing Comment

by:AMPLECOMPUTERS
ID: 39266259
I was just about to be rude as I had already been to that site and tried it. Thought I would try it one more time just to make sure. Evidently I typed something wrong my first try as this time it worked perfectly. Thanks!
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39266292
Glad you got it working.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

623 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