Solved

Connecting Access to Mysql for recordset using ADO

Posted on 2013-06-21
3
768 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 26

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 26

Expert Comment

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

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now