Build WHERE -> insert_fields() failed.

Dear experts,
i have a vb6 program with mysql database. i have this module to update the database. I have it up and running before but today whenever i run it, i encounter this [MySQL][ODBC5.1 Driver][mysqld-5.1.33-community]Build WHERE -> insert_fields() failed.

any ideas what might have caused this problem experts? thank you for the input.
Who is Participating?
ee_autoConnect With a Mentor Commented:
Question PAQ'd, 125 points refunded, and stored in the solution database.
MySQL with VB! A marriage made in hell. Please post the code that generates the sql, the schema of the db table, and if the sql statement is dynamic, please post the final sql statement sent to odbc_query.
SlythieAuthor Commented:
The code in VB is as follows:

Set ac = New ADODB.Connection
Set ar = New ADODB.Recordset
ac.Open "dsn=pptkis"

ar.Open "select * from asuransi where asuransi_no = '" & ListView1.ListItems(ListView1.SelectedItem.Index).Text & "'", ac, adOpenDynamic, adLockOptimistic
If Not ar.EOF Then
ar!asuransi_tki_name = Text5
end if

just a few days ago, this code was working just fine

in the table asuransi, it contains the following fields:
- asuransi_no [varchar(50)]
- asuransi_tki_name [varchar(50)]     <---- this is the field needs to be updated
- asuransi_cabang_kode [varchar(3)]

SlythieAuthor Commented:
nvm about this problem... I found out that it was my stupid mistakes, trying to update one field but there are some other "NOT NULL" fields and they require values.. thx for trying to help v2Media.. =)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.