hi
thanks for ur suggessions
now i got mysql connection with vb
but i need to use the mysql Queries in this application
hope i wil get solution
thank u very much

Recommended Answers

All 8 Replies

There is no difference in using access or oracle or mysql queries in VB. The process is all the same.

for select statments (opening recordset)

rs.open "your sql statment here"

for any DML

conn.BeginTrans
conn.Execute "Your sql statment here"
Conn.CommitTrans

i got this from some where
rs.Open "SELECT * FROM tbl_student_biodata", conn, 1, 2

u said only
rs.Open "SELECT * FROM tbl_student_biodata"
then what abt the rest of the statement
anyway im not getting it.
plz explain

Dim rs As ADODB.Recordset
    Dim adoConn As ADODB.Connection
    
    Set adoConn = New ADODB.Connection
    adoConn.ConnectionString = sqlcon
    adoConn.Open
    
    Set rs = New ADODB.Recordset
    rs.ActiveConnection = adoConn
    rs.LockType = adLockOptimistic
    rs.CursorLocation = adUseClient
    rs.CursorType = adOpenDynamic
     
    rs.Open sqlstr

i need to generate an id card
for that i need to display the details such as name etc which must be accessed from a mysql database and now i know how to connect to mysql database and use select statement but dont know how to display the data accessed
plz help

thanks to every body i got my problem solved and here is the code

Dim rs As ADODB.Recordset
Dim adoconn As ADODB.Connection


Private Sub Command1_Click()

Set adoconn = New ADODB.Connection

adoconn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=mca;UID=root;PWD=;OPTION=3;"

adoconn.Open

Set rs = New ADODB.Recordset

rs.ActiveConnection = adoconn

rs.LockType = adLockOptimistic

rs.CursorLocation = adUseClient

rs.CursorType = adOpenDynamic

rs.Open "SELECT " & Label1.Caption & " FROM tbl_student_biodata where name='BINU TESSY JAMES'"

While Not rs.EOF

Text1.Text = rs!Name

rs.MoveNext

Wend

End Sub

how do you want it to be displayed?

thanks for ur concern i have got the solution

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.