Link to home
Start Free TrialLog in
Avatar of Slythie
Slythie

asked on

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.
Avatar of v2Media
v2Media
Flag of Australia image

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.
Avatar of Slythie
Slythie

ASKER

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
ar.Update
ar.Close
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)]

Avatar of Slythie

ASKER

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.. =)
ASKER CERTIFIED SOLUTION
Avatar of ee_auto
ee_auto

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial