Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2012
    Posts
    2

    Red face Unanswered: trying to connect

    I was trying to connect my system using visual basic 6 and mysql phpmyadmin wamp server..i connected it but the problem is my codes in vb6 because the previous database of my system is Microsoft Access 2007 and i convert it to mysql..

    i got this problem ,my system is ordering and inventory system..
    can you please help me..here''s my codes thanks if you can help

    Private Sub cmdDone_Click()
    Dim sql As String
    Set rsAcc = New ADODB.Recordset
    sql = "select * from trans"

    rsAcc.Open sql, cnnAcc, adOpenDynamic, adLockBatchOptimistic


    For i = 1 To lstrecord.ListCount
    lstrecord.ListIndex = 0
    List1.ListIndex = 0

    'If rsAcc.EOF And rsAcc.BOF Then
    sql = "select * from trans"
    'rsItems(4) = Val(rsItems(4)) - Val(List1.Text)
    'rsItems.Update
    'rsItems.Requery
    'Else
    rsItems.MoveNext
    GoTo i

    'End If
    Next i



    If DataEnvironment1.rsCommand1.State = adStateOpen Then
    DataEnvironment1.rsCommand1.Close
    End If


    If rsAcc.EOF And rsAcc.BOF Then
    rsAcc.AddNew
    rsAcc(0) = 1 'trans_id
    rsAcc(1) = lblLfullname.Caption 'Member_name
    rsAcc(2) = lbladd.Caption 'Member_add
    rsAcc(3) = lblAge.Caption 'Member_Age
    rsAcc(4) = txtbill.Text 'Bill
    rsAcc(5) = txtchange.Text 'Change
    rsAcc(6) = txttol.Text 'Amount
    rsAcc(7) = lblrecord.Caption 'Prodname
    rsAcc(8) = Val(List1.Text) 'Quantity


    rsAcc.Update
    rsAcc.Requery

    DataEnvironment1.rsCommand1.Filter = "Order_id = " & 1
    DataReport2.Show

    If DataEnvironment1.rsCommand1.State = adStateOpen Then
    DataEnvironment1.rsCommand1.Close
    End If

    Unload Me
    Unload frmOrder
    Unload frmSearch
    Unload frmSearchProduct

    Else
    rsAcc.MoveLast
    num = rsAcc(0) + 1
    rsAcc.AddNew
    rsAcc(0) = num
    rsAcc(1) = lblLfullname.Caption
    rsAcc(2) = lbladd.Caption
    rsAcc(3) = lblAge.Caption
    rsAcc(4) = txtbill.Text
    rsAcc(5) = txtchange.Text
    rsAcc(6) = txttol.Text
    rsAcc(7) = lblrecord.Caption
    rsAcc(8) = Val(List1.Text)
    rsAcc(9) = Date
    rsAcc.Update
    rsAcc.Requery
    If DataEnvironment1.rsCommand1.State = adStateOpen Then DataEnvironment1.rsCommand1.Close
    DataEnvironment1.rsCommand1.Filter = "tran_id = " & num
    DataReport1.Show

    DataEnvironment1.rsCommand1.Filter = "Trans_id= " & num
    DataReport2.Show

    Unload Me
    Unload frmOrder
    Unload frmSearch
    Unload frmSearchProduct

    End If
    End Sub

  2. #2
    Join Date
    Mar 2012
    Posts
    2

    Red face Rush

    please i need it as soon as possible..

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so what is the problem, or problems you are experiencing
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    Is there an error message and if yes what is it?
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

Posting Permissions

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