View Single Post
  #9 (permalink)  
Old 07-31-06, 09:17 PM
dzol dzol is offline
Newbie Coder
 
Join Date: Jul 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
thanks for your answer but...

when i use the code that u give, error at
Code:
Else If EnglishWordTxt.Text = EnglishWordTxt.Text Then
when change to this
Code:
Private Sub ConvertMalay_Click()

'if user not type anything
If EnglishWordTxt.Text = "" Then
    TextMessage1 = MsgBox("Please type the word first", vbOKOnly, "Caution")

'Lets see if user type a word that's in the database
Else
If EnglishWordTxt.Text = EnglishWordTxt.Text Then

    'set up remote data connection using the MySQL ODBC driver
    cnMySql.CursorDriver = rdUseOdbc
    cnMySql.Connect = "uid=root;pwd=1234;server=localhost;" & _
        "driver={MySQL ODBC 3.51 Driver};database=kamus;dsn='';"
    cnMySql.EstablishConnection

    With rdoQry
        .Name = "malayword"
        .SQL = "SELECT malayword, explanation FROM a WHERE englishword = '" & EnglishWordTxt.Text & "'"
        .RowsetSize = 1
        Set .ActiveConnection = cnMySql
        Set rdoRS = .OpenResultset(rdOpenKeyset, rdConcurRowVer)
    End With
    
    MalayWordTxt.Text = ""
    ExplanationTxt.Text = ""
    
        With rdoRS
        MalayWordTxt.Text = MalayWordTxt.Text & !malayword
        ExplanationTxt.Text = ExplanationTxt.Text & !explanation
        End With
        
    rdoRS.Close
    cnMySql.Close

    If ExplanationTxt.Text = "" Then
        TextMessage2 = MsgBox("Sorry, your word is not in this dictionary", vbOKOnly, "Caution")
    End If
    
End If
End If
End Sub
error at,
Code:
cnMySql.EstablishConnection
can u tell me what's wrong
Reply With Quote