mehran63
پنج شنبه 30 اردیبهشت 1389, 19:18 عصر
سلام
من کد زير را براي انجام تغييرات در رکورد هايي که قبلا توسط کاربر ساخته شده با دستور update نوشتم ولي وقتي دستو را اجرا ميکنم خطاي Run Time error '-2147217900(80040e14) که در زيرش مينويسه syntax error in UPDATE statement و وقتي روي Debug اين خطا کليک ميکنم ميره روي خط کدي که نوشتم adodc1.recordset.open a که در پايين کل اين دستور رو گذاشتم لطفا اگه کسي ميدونه يا روش ديگه اي براي update بلده بگه که هم من مشکلم رفع بشه هم دوستان ديگه اي که اين مشکل رو دارن استفاده کنن
Private Sub cmdsave_Click()
a = "update tperson set code=" + txtcode.Text + ", name='" + txtname.Text + "',family='" + txtfamily.Text + _
"',moaref='" + txtmoaref.Text + _
"',tell='" + txttell.Text + _
"',mobile='" + txtmobile.Text + _
"',karor=" + txtkaror.Text + _
",sineh=" + txtsine.Text + _
",basen=" + txtbasen.Text + _
",ghad=" + txtghade.Text + _
",bluz=" + txtbluz.Text + _
",coat=" + txtcoat.Text + _
",pirahan=" + txtpirahan.Text + _
",daman=" + txtdaman.Text + _
",shalvar=" + txtshalvar.Text + _
",rupush=" + txtrupush.Text + _
",sarshaneh=" + txtsarshane.Text + _
",astin=" + txtastin.Text + _
",tarikh-pruv-1=" + Trim(txtyp1.Text) + "/" + Trim(txtmp1.Text) + "/" + Trim(txtdp1.Text) + _
",tarikh-pruv-2=" + Trim(txtyp2.Text) + "/" + Trim(txtmp2.Text) + "/" + Trim(txtdp2.Text) + _
",tarikh-tahvil=" + Trim(txtytt.Text) + "/" + Trim(txtmtt.Text) + "/" + Trim(txtdtt.Text) + _
",day-tp1='" + J_WEEKDAY(Trim(txtyp1.Text) + "/" + Trim(txtmp1.Text) + "/" + Trim(txtdp1.Text), 1) + _
"',day-tp2='" + J_WEEKDAY(Trim(txtyp2.Text) + "/" + Trim(txtmp2.Text) + "/" + Trim(txtdp2.Text), 1) + _
"',day-tt='" + J_WEEKDAY(Trim(txtytt.Text) + "/" + Trim(txtmtt.Text) + "/" + Trim(txtdtt.Text), 1) + _
"',discription='" + txtdescription.Text + _
"' where code=" + txtcode.Text
Adodc1.Refresh
Adodc1.Recordset.Close
Adodc1.Recordset.Open a
End Sub
من کد زير را براي انجام تغييرات در رکورد هايي که قبلا توسط کاربر ساخته شده با دستور update نوشتم ولي وقتي دستو را اجرا ميکنم خطاي Run Time error '-2147217900(80040e14) که در زيرش مينويسه syntax error in UPDATE statement و وقتي روي Debug اين خطا کليک ميکنم ميره روي خط کدي که نوشتم adodc1.recordset.open a که در پايين کل اين دستور رو گذاشتم لطفا اگه کسي ميدونه يا روش ديگه اي براي update بلده بگه که هم من مشکلم رفع بشه هم دوستان ديگه اي که اين مشکل رو دارن استفاده کنن
Private Sub cmdsave_Click()
a = "update tperson set code=" + txtcode.Text + ", name='" + txtname.Text + "',family='" + txtfamily.Text + _
"',moaref='" + txtmoaref.Text + _
"',tell='" + txttell.Text + _
"',mobile='" + txtmobile.Text + _
"',karor=" + txtkaror.Text + _
",sineh=" + txtsine.Text + _
",basen=" + txtbasen.Text + _
",ghad=" + txtghade.Text + _
",bluz=" + txtbluz.Text + _
",coat=" + txtcoat.Text + _
",pirahan=" + txtpirahan.Text + _
",daman=" + txtdaman.Text + _
",shalvar=" + txtshalvar.Text + _
",rupush=" + txtrupush.Text + _
",sarshaneh=" + txtsarshane.Text + _
",astin=" + txtastin.Text + _
",tarikh-pruv-1=" + Trim(txtyp1.Text) + "/" + Trim(txtmp1.Text) + "/" + Trim(txtdp1.Text) + _
",tarikh-pruv-2=" + Trim(txtyp2.Text) + "/" + Trim(txtmp2.Text) + "/" + Trim(txtdp2.Text) + _
",tarikh-tahvil=" + Trim(txtytt.Text) + "/" + Trim(txtmtt.Text) + "/" + Trim(txtdtt.Text) + _
",day-tp1='" + J_WEEKDAY(Trim(txtyp1.Text) + "/" + Trim(txtmp1.Text) + "/" + Trim(txtdp1.Text), 1) + _
"',day-tp2='" + J_WEEKDAY(Trim(txtyp2.Text) + "/" + Trim(txtmp2.Text) + "/" + Trim(txtdp2.Text), 1) + _
"',day-tt='" + J_WEEKDAY(Trim(txtytt.Text) + "/" + Trim(txtmtt.Text) + "/" + Trim(txtdtt.Text), 1) + _
"',discription='" + txtdescription.Text + _
"' where code=" + txtcode.Text
Adodc1.Refresh
Adodc1.Recordset.Close
Adodc1.Recordset.Open a
End Sub