Solved

Connecting Access to Mysql for recordset using ADO

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
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…

820 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