Results 1 to 2 of 2

Thread: Urgent Help Needed on VB/MySql

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2005
    Posts
    1

    Urgent Help Needed on VB/MySql

    Hello

    Need urgent help on this.


    I am currently working on an application in VB 6.0 and the database is MySQL .

    The purpose of this code is to calculate the number of non empty fields in the table DailyQCRed from columns 4 to 40 ignoring in between columns 34 to 37.

    Please note that I have tried both Dynamic, Keyset recrodsets and optimistic and pessimistic locking. Still I get errors.

    In the code below I get the error that says

    "Query based update failed because the row to update could not be found"

    rstRecordset.Open "Select * from DailyQCRed", cn, adOpenDynamic, adLockPessimistic
    Do While Not rstRecordset.EOF
    ifld = 0
    For i = 4 To 40
    If i < 34 Or i > 37 Then
    If rstRecordset.Fields(i).Value <> "" Then
    ifld = ifld + 1
    End If
    End If
    Next i
    rstRecordset!FillFields = ifld
    rstRecordset.Update
    rstRecordset.MoveNext
    Loop
    rstRecordset.Close

    Can anyone help me incase there is something wrong with the logic though I think the logic is OK. I tried to get the figures by putting message boxes and they came correct. I think the error lies in the syntax. Perhaps the syntax used for Mysql dtabase update through VB is different from the one I have used above.

    Is there any Mysql version issue. I am working on MySQL Ver 4.0.

    Thanks
    Manish

  2. #2
    Frenzied Member David.Poundall's Avatar
    Join Date
    Sep 2002
    Location
    Robin Hood Land
    Posts
    1,457

    Re: Urgent Help Needed on VB/MySql

    How are you calling the MySQL database. What is the connect string?
    David

    Learn the Rules so that you know how to break them properly.

    Printing dll dBTools MZTools Winsock API WinsockVB More Winsock SGrid2 MSChart Mail2Web

    If you have found this thread useful then read this

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