Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Connecting Access to Mysql for recordset using ADO

Posted on 2013-06-21
3
Medium Priority
?
836 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 28

Accepted Solution

by:
MacroShadow earned 2000 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 28

Expert Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

971 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