Z zws Unregistered / Unconfirmed GUEST, unregistred user! 2000-09-12 #1 在QUERY控件中怎样使用SQL语句(SELECT,INSERT,UPDATE,DELETE),能否给出例子?
Y yunshang Unregistered / Unconfirmed GUEST, unregistred user! 2000-09-12 #2 Query1.Close; Query1.SQL.Clear; Query1.SQL.Add('Delete from Country where Name = ''Argentina'''); Query1.ExecSQL;
Query1.Close; Query1.SQL.Clear; Query1.SQL.Add('Delete from Country where Name = ''Argentina'''); Query1.ExecSQL;
Y yangtt Unregistered / Unconfirmed GUEST, unregistred user! 2000-09-12 #3 同上. 另外:select 时 query1.execsql update,insert,delete 时 query1.open
追 追命 Unregistered / Unconfirmed GUEST, unregistred user! 2000-09-12 #4 >> select 时 query1.execsql >> update,insert,delete 时 query1.open 全反了,不是晕了吧,select时 select 时 query1.open update,insert,delete 时 query1.execsql
>> select 时 query1.execsql >> update,insert,delete 时 query1.open 全反了,不是晕了吧,select时 select 时 query1.open update,insert,delete 时 query1.execsql
Y yangtt Unregistered / Unconfirmed GUEST, unregistred user! 2000-09-12 #5 sorry! 写错了.select 时: query1.open update,insert,delete 时:query1.execsql 如:Query1.SQL.Add('select * from Country where Name ='+''''+edit1.text+''''); Query1.SQL.Add('insert into Country (name...) valuesvalue1,..));(用参数)
sorry! 写错了.select 时: query1.open update,insert,delete 时:query1.execsql 如:Query1.SQL.Add('select * from Country where Name ='+''''+edit1.text+''''); Query1.SQL.Add('insert into Country (name...) valuesvalue1,..));(用参数)
F FLY_IN_SKY Unregistered / Unconfirmed GUEST, unregistred user! 2000-09-12 #6 open 最好加上query.prepare
Z zws Unregistered / Unconfirmed GUEST, unregistred user! 2000-09-12 #7 在insert,update,delete时要用到edit1.text时,当字段类型为数值,字符,日期型时, 分别应怎样写,我看了好几本DELPHI书也没有这方面的内容,敬请指教!
Y yunshang Unregistered / Unconfirmed GUEST, unregistred user! 2000-09-13 #8 Query1.Close; Query1.SQL.Clear; Query1.SQL.Add('Delete from Country where Name = :NAME'); Query1.ParamByName('NAME').ASSTRING:=EDIT1.TEXT; Query1.ExecSQL; 如果是数值,用:ASFLOAT或ASDOUBLE等 如果是日期,用:ASDATE,ASDATETIME
Query1.Close; Query1.SQL.Clear; Query1.SQL.Add('Delete from Country where Name = :NAME'); Query1.ParamByName('NAME').ASSTRING:=EDIT1.TEXT; Query1.ExecSQL; 如果是数值,用:ASFLOAT或ASDOUBLE等 如果是日期,用:ASDATE,ASDATETIME