Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6848821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:54:56+00:00 2026-05-27T00:54:56+00:00

I am using visual basic 6. I have a button created which when pressed

  • 0

I am using visual basic 6. I have a button created which when pressed should display all the entries of the table. I am using following code to connect to MySQL database. I have used the Microsoft Remote Data Services as my reference

code:

Private Sub cmdConnectMySQL_Click()
Dim cnMySql As New rdoConnection
Dim rdoQry  As New rdoQuery
Dim rdoRS   As rdoResultset

  cnMySql.CursorDriver = rdUseOdbc
  cnMySql.Connect = "uid=root;pwd=;
  server=localhost; driver={MySQL ODBC 3.51 Driver};
  database=demo;dsn=;"
  cnMySql.EstablishConnection
  With rdoQry
    .Name = "selectUsers"
    .SQL = "select * from user"
    .RowsetSize = 1
    Set .ActiveConnection = cnMySql
    Set rdoRS = .OpenResultset(rdOpenKeyset, rdConcurRowVer)
  End With

  Do Until rdoRS.EOF
    With rdoRS
      rdoRS.MoveNext
    End With
  Loop
  rdoRS.Close
  cnMySql.Close

End Sub 

I am not able to connect to the database. How do I connect?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:54:57+00:00Added an answer on May 27, 2026 at 12:54 am

    Can you try it using ADO instead of RDO?

    • Add a reference to the Microsoft ActiveX Data Objects 2.8 Library
    • Set up an ODBC DSN to connect to the database

    Then use code something like this

    Dim cnConnection As ADODB.Connection
    Dim adorsRecordSet As ADODB.Recordset
    Dim sDatabase As String
    Dim sSQL As String
    
    sDatabase = "NameOfTheMysqlDSN"
    sSQL= "Select * From user"
    
    Set cnConnection = New ADODB.Connection
    cnConnection.Open sDatabase
    Set adorsRecordSet = New ADODB.Recordset
    
    adorsRecordSet.Open sSQL, cnConnection 
    
    Do Until (adorsRecordSet.EOF)
         adorsRecordSet.MoveNext
    Loop
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Visual Basic 6 I have the following code structure: FUNCNINFO is
I'm using Visual Basic 9 (VS2008) and TagLib. The following code extracts the album
i have a form created using Visual Basic 2008 in c# i want to
I am using Visual Studio 2008. I have created a visual basic form that
I am using visual basic for coding. In my form I have a delete
I have written a basic Application for windows mobile 5. It is using visual
We have developed a standalone application using visual basic 6. Now we are changing
I'm using Visual Basic 2010 Express. I have a form that can be minimized.
I have a MultiThreading issue and conceptual question using Visual Basic (but it applies
I have an interesting problem. I'm using visual basic and before saving a row

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.