Results 1 to 5 of 5

Thread: Send query to online mySQL Database

  1. #1

    Thread Starter
    Addicted Member Illiad's Avatar
    Join Date
    Mar 2003
    Location
    Chicago
    Posts
    196

    Send query to online mySQL Database

    Hi, been searching the fourms for a good anwser but I didn't come up with anything...

    Basically I need to send queries to an external mySQL database via VB6. My questions are:
    - How do I connect to a mySQL database? Which controller or referance is best?
    - How do I send queries to the database and store them in variables? (clean cut, each query should only return one value as a double)

    Havn't done Vb in a while so giant newb anwsers would be helpful.
    Thanks for any response.
    Quis Custodiet Ipsos Custodes?

    You don't have to be faster than the bear, you just have to be faster than the slowest person running from the bear.

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Send query to online mySQL Database

    welcome back, Illiad

    use ado to connect to the database. search for ado in this forum. there are lots of examples for the connections and queries.
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  3. #3
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: Send query to online mySQL Database

    use ado and connection strings

    http://www.connectionstrings.com
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  4. #4

    Thread Starter
    Addicted Member Illiad's Avatar
    Join Date
    Mar 2003
    Location
    Chicago
    Posts
    196

    Re: Send query to online mySQL Database

    Okay, searching ADO is get code samples like this.

    VB Code:
    1. Dim rsMyRecordSet As ADODB.Recordset
    2. Dim sSQL As String
    3.  
    4. Set rsMyRecordSet = New ADODB.Recordset
    5. sSQL = "SELECT field FROM table....etc"
    6. rsMyRecordSet.Open sSQL, CurrentProject.Connection

    I'm trying to decipher it piece by piece, sSQL seems to by the query I want to send and the last line apparently sends the query I'm assuming. Where am I supposed to input all the connection parapamters such as IP, login name, password, etc?

    Moreover, how do I manipulate this record set object after I get the response?
    Quis Custodiet Ipsos Custodes?

    You don't have to be faster than the bear, you just have to be faster than the slowest person running from the bear.

  5. #5
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Send query to online mySQL Database

    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width