hay..
i wanna ask something, are my script is right to execute to update data on table sql server using vfp 8
on load form vfp
public KONEKSI, mskedul1
STORE SQLCONNECT('dana','dana','dana_database') TO KONEKSI
IF KONEKSI > 0
endif
SQLTables(m.KONEKSI,'TABLE','tableList')
on init form vfp
thisform.grid1.recordsource = 'tablelist'
on destroy form vfp
STORE SQLCONNECT('dana','dana','dana_database') TO KONEKSI
IF KONEKSI > 0
SQLEXEC(KONEKSI,'use ksp_arthadana')
endif
SQLDisconnect(KONEKSI)
on click event my commandbutton vfp
If m.KONEKSI > 0
LOCAL lnResult
lcValue = Thisform.text4.Value
lnResult = SQLExec(KONEKSI, "select * from dbo.customer where cif = ?m.lcValue", "nasabah1")
IF m.lnResult > 0
lcValue1 = thisform.text6.value or 07/10/2024 02:30:00
lcExeCmd= "INSERT INTO dbo.nasabah (date) VALUES (?m.lcValue1) where cif = ?m.lcValue"
SQLEXEC(KONEKSI, lcExeCmd)
Messagebox('Data Has Been Save..!!')
Else
Aerror(laErrors)
Messagebox('Error: ' + laErrors[2])
Endif
endif
for compare i also add one more command button at my form
on click event my commandbutton1 vfp
If m.KONEKSI > 0
lcValue = thisform.text4.value
lcValue1 = thisform.text6.value or 07/10/2024 02:30:00
TEXT TO lcUpdCmd NOSHOW TEXTMERGE
UPDATE DBO.customer SET date = ?m.lcValue1
where cif = ?m.lcValue
ENDTEXT
SQLEXEC(KONEKSI, lcUpdCmd)
Messagebox('Data Has Been Save..!!')
Else
Aerror(laErrors)
Messagebox('Error: ' + laErrors[2])
endif
property for text4 vfp are numeric same like sql server datatype numeric property text6 are blank or none maybe general datatype
and i browse based on dbo.customer there is no change data, i mean date at my dbo.customer before i update are like this 02/05/2024 02:30:00 AM and i want to update like lcValue1 above. then can someone explain me why and what should i do to make it correct..
i wanna ask something, are my script is right to execute to update data on table sql server using vfp 8
on load form vfp
public KONEKSI, mskedul1
STORE SQLCONNECT('dana','dana','dana_database') TO KONEKSI
IF KONEKSI > 0
SQLEXEC(KONEKSI,'use ksp_arthadana')endif
SQLTables(m.KONEKSI,'TABLE','tableList')
on init form vfp
thisform.grid1.recordsource = 'tablelist'
on destroy form vfp
STORE SQLCONNECT('dana','dana','dana_database') TO KONEKSI
IF KONEKSI > 0
SQLEXEC(KONEKSI,'use ksp_arthadana')
endif
SQLDisconnect(KONEKSI)
on click event my commandbutton vfp
If m.KONEKSI > 0
LOCAL lnResult
lcValue = Thisform.text4.Value
lnResult = SQLExec(KONEKSI, "select * from dbo.customer where cif = ?m.lcValue", "nasabah1")
IF m.lnResult > 0
lcValue1 = thisform.text6.value or 07/10/2024 02:30:00
lcExeCmd= "INSERT INTO dbo.nasabah (date) VALUES (?m.lcValue1) where cif = ?m.lcValue"
SQLEXEC(KONEKSI, lcExeCmd)
Messagebox('Data Has Been Save..!!')
Else
Aerror(laErrors)
Messagebox('Error: ' + laErrors[2])
Endif
endif
for compare i also add one more command button at my form
on click event my commandbutton1 vfp
If m.KONEKSI > 0
lcValue = thisform.text4.value
lcValue1 = thisform.text6.value or 07/10/2024 02:30:00
TEXT TO lcUpdCmd NOSHOW TEXTMERGE
UPDATE DBO.customer SET date = ?m.lcValue1
where cif = ?m.lcValue
ENDTEXT
SQLEXEC(KONEKSI, lcUpdCmd)
Messagebox('Data Has Been Save..!!')
Else
Aerror(laErrors)
Messagebox('Error: ' + laErrors[2])
endif
property for text4 vfp are numeric same like sql server datatype numeric property text6 are blank or none maybe general datatype
and i browse based on dbo.customer there is no change data, i mean date at my dbo.customer before i update are like this 02/05/2024 02:30:00 AM and i want to update like lcValue1 above. then can someone explain me why and what should i do to make it correct..