»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 01-28-2004, 02:58 PM   #1 (permalink)
Registered User
 
Join Date: Jan 2003
Location: Orange, Mass.
Posts: 490
Blazer06 is on a distinguished road
Send a message via AIM to Blazer06
How do i use Mysql with VB 6.0

...???
what i want to do is use a MySQL database from VB.. a short tutorial or code example would be much appriciative.


Blaze

Blazer06 is offline   Reply With Quote
Old 02-01-2004, 04:06 PM   #2 (permalink)
Registered User
 
shawshank62's Avatar
 
Join Date: Oct 2002
Location: Southampton, PA
Posts: 2,279
shawshank62 is on a distinguished road
Send a message via ICQ to shawshank62 Send a message via AIM to shawshank62 Send a message via Yahoo to shawshank62
im an idiot in this area....but

shouldnt it come with the code to type? And then you can just imput that code into something like phpMYadmin
shawshank62 is offline   Reply With Quote
Old 02-01-2004, 04:16 PM   #3 (permalink)
Registered User
 
Join Date: Jan 2003
Location: Orange, Mass.
Posts: 490
Blazer06 is on a distinguished road
Send a message via AIM to Blazer06
umm.... it doesnt and after reading about 250 web pages (mostly junk), and 5 minutes of codeing i got this which reads from the database after connecting.

Option Explicit

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

' set up remote data connection using the
' MySQL ODBC driver

cnMySql.CursorDriver = rdUseOdbc
cnMySql.Connect = "uid=blaze;pwd=;server=Blaze;" & _
"driver={MySQL ODBC 3.51 Driver};database=test;dsn='';"
cnMySql.EstablishConnection

With rdoQry
.Name = "selectUsers"
.SQL = "select * from my"
.RowsetSize = 1
Set .ActiveConnection = cnMySql
Set rdoRS = .OpenResultset(rdOpenKeyset, rdConcurRowVer)
End With

txtMySQL.Text = ""

Do Until rdoRS.EOF
With rdoRS
txtMySQL.Text = txtMySQL.Text & !First & " - " & !Last & vbCrLf

rdoRS.MoveNext
End With
Loop

rdoRS.Close
cnMySql.Close
End Sub


just need to get it to write and improvise from there.


Blaze
Blazer06 is offline   Reply With Quote
Old 02-01-2004, 04:43 PM   #4 (permalink)
Registered User
 
Agent_Embryo's Avatar
 
Join Date: Oct 2001
Location: Sweden
Posts: 1,260
Agent_Embryo is on a distinguished road
Send a message via ICQ to Agent_Embryo
You need to send SQL commands to MySQL in order to read and write to the database. That code uses "SELECT * from my" to get the information in the database table my (from what I can tell).

Search for some SQL reference webpages. You'll figure it out in notime.
Agent_Embryo is offline   Reply With Quote
Old 02-01-2004, 04:45 PM   #5 (permalink)
Registered User
 
Join Date: Jan 2003
Location: Orange, Mass.
Posts: 490
Blazer06 is on a distinguished road
Send a message via AIM to Blazer06
yeah yeah.. i know alittle mysql (select, insert, update, create), but i need to write alittle in my program to send those to the server. which i just did.

thanks however, google rocks.. jsut the first 100 sites it found didnt.


Blaze
Blazer06 is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 01:21 PM.