我在SQL存储过程中定义了一个变量@comb,在存储过程中我是是以它为查询的
我如何把@comb传到窗体中的ComboBox2.text 值来查询
这样调用可以吗(GetSomeSearch 是存储过程名)
var
mDate: TDateTime;
mYear, mMonth, mDay:word;
@comb:STRING;begin
@comb:=ComboBox1.text;
ADOQuery1.SQL.Add('Exec GetSomeSearch ' + FloattoStr(mYear) + ',' + FloattoStr(mMonth));
应该如何写呢
我如何把@comb传到窗体中的ComboBox2.text 值来查询
这样调用可以吗(GetSomeSearch 是存储过程名)
var
mDate: TDateTime;
mYear, mMonth, mDay:word;
@comb:STRING;begin
@comb:=ComboBox1.text;
ADOQuery1.SQL.Add('Exec GetSomeSearch ' + FloattoStr(mYear) + ',' + FloattoStr(mMonth));
应该如何写呢
解决方案 »
- cxGrid1DBTableView1.datacontroller.column[1].value:='dfsdf'可以吗
- 求Idhttp1 post方式访问网页的例子
- 简单问题(送40分)
- Unable to locate file 'jpeg.pas'是什么错误?
- 一个很简单的问题,请帮我解决,50分!在线等!谢谢!
- 我爱开蓝鸟!
- 高分求Sui那公司的控件?
- 如何对输出的浮点数进行限制位数?
- 为什么我安装了windows speech sdk5.1和它的语言包后在windows目录下没有speech子目录呢?整个盘下也没有Vtxtauto.tlb这个文件呢?
- Delphi能否开发B/S应用,如果能,那么与使用JBuilder开发B/S应用有什么异同点?
- 关于dbgrid
- 问个ComboBox的简单问题,在线等~
procedure TForm1.FormCreate(Sender: TObject);
begin
with ADOStoredProc1 do
begin
Close;
ProcedureName := 'GetSomeSearch;1';
Parameters.Refresh;
Parameters.ParamByName('@mYear').Value:=mYear;
Parameters.ParamByName('@mMonth').Value:=mMonth;
Parameters.ParamByName('@comb').Value:=ComboBox1.text;
Open;//如果插入更新为ExecSql;
end;
end;
2.
ADOQuery1.SQL.Add('Exec GetSomeSearch ' + FloattoStr(mYear) + ',' + FloattoStr(mMonth)) + ',' + QuotedStr(ComboBox1.text);
begin
With ADOQuery1 Do Begin
Close;
SQL.Clear ;
SQL.Add(' EXECUTE Test :aa, :bb, :cc Output, :dd Output ') ;
Parameters.Items[0].Value := 'Test aa';
Parameters.Items[1].Value := 1234;
Prepared;
ExecSQL;
Edit1.Text := Parameters.Items[2].Value + ' : ' + IntToStr(Parameters.Items[3].Value);
Close;
end;
end;