Solved

Connecting Access to Mysql for recordset using ADO

Posted on 2013-06-21
3
780 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

777 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