T TIDE_LIU Unregistered / Unconfirmed GUEST, unregistred user! 2001-09-10 #1 如何在TADODATASET.COMMANDTEXT中实现类似于 SELECT * FROM TABLEA WHERE TABLEA.LABEL1=EDIT.TEXT; 的功能?
Q qiubole Unregistered / Unconfirmed GUEST, unregistred user! 2001-09-10 #2 sqlstr:='select * from tablea wehre tablea.label1='+edit.text; commandtext:=sqlstr; tadodataset的属性commandtype默认就是cmdText active为true
sqlstr:='select * from tablea wehre tablea.label1='+edit.text; commandtext:=sqlstr; tadodataset的属性commandtype默认就是cmdText active为true
S sumingfei Unregistered / Unconfirmed GUEST, unregistred user! 2001-09-10 #4 你了可以这样: 用参数动态传递EDIT.TEXT的值 AdoDataSet1.CommandText := 'Select * from Table Where Label1=:Value'; // AdoDataSet1.Close; AdoDataSet1.Params.ParamByName('Value').AsString := Edit1.Text; AdoDataSet1.Open; //
你了可以这样: 用参数动态传递EDIT.TEXT的值 AdoDataSet1.CommandText := 'Select * from Table Where Label1=:Value'; // AdoDataSet1.Close; AdoDataSet1.Params.ParamByName('Value').AsString := Edit1.Text; AdoDataSet1.Open; //
T TIDE_LIU Unregistered / Unconfirmed GUEST, unregistred user! 2001-09-11 #5 大家再来关注一下, 我使用 ADODATASET1.PARAMS 就报错!说是找不到这个参数! 为什么?
山 山泉 Unregistered / Unconfirmed GUEST, unregistred user! 2001-09-11 #7 procedure DoAdoSql(CurADODS: TADODataSet; SSql: string); var oldcur: tcursor; begin oldcur := Screen.Cursor; screen.cursor := crHourGlass; try if CurADODS.Active = true then CurADODS.Close; CurADODS.CommandText := SSql; CurADODS.Open; finally screen.Cursor := oldcur; end; end;
procedure DoAdoSql(CurADODS: TADODataSet; SSql: string); var oldcur: tcursor; begin oldcur := Screen.Cursor; screen.cursor := crHourGlass; try if CurADODS.Active = true then CurADODS.Close; CurADODS.CommandText := SSql; CurADODS.Open; finally screen.Cursor := oldcur; end; end;
山 山泉 Unregistered / Unconfirmed GUEST, unregistred user! 2001-09-11 #8 调用 var ssql:string; begin ssql:='select 品名,日期,SUM(数量) from alljihuaserver group by 品名,日期 '; ssql:=ssql+' HAVING (日期 = CONVERT(DATETIME,'+''''+datetimetostr(DateTimePicker3.date) + ''',102))'; doadosql(dm1.DSprtj, ssql)
调用 var ssql:string; begin ssql:='select 品名,日期,SUM(数量) from alljihuaserver group by 品名,日期 '; ssql:=ssql+' HAVING (日期 = CONVERT(DATETIME,'+''''+datetimetostr(DateTimePicker3.date) + ''',102))'; doadosql(dm1.DSprtj, ssql)
Y yobdrow Unregistered / Unconfirmed GUEST, unregistred user! 2001-09-11 #9 上面可以了 参数是这样调用的 dataset.parameters.parambyname('参数名‘).value:=实际值