像C中的EXEC SQL SELECT * FROM ....的用法而不必拘泥于控件中使用。
请大虾指点。万分感谢。
请大虾指点。万分感谢。
解决方案 »
- 用DELPHI播放SWF文件如何取得帧频参数
- 如何利用adoquery的append,post或者upbatch属性来实现输一条数据保存一行
- vsscomm32.res 文件没有咋办。。。。??
- ADOQuery的疑问!
- ★★★★★★不知不觉当中,我有三个角啦!散分——————★★★★★★
- 一个Tquery组件的使用问题,非常急!!!!!!!!!!!!
- delphi中DLL中生成的窗口在任务栏会显示一个图标怎样隐藏?
- 请问各位大侠能否推荐一本入门delphi6的好书,菜鸟在这里先谢谢啦
- 接口引用和对象的兼容性问题,想不明白……
- 用过pcAnyWhere的兄弟进来看看
- 怎样使在800*600像素开发的程序,在1024*768中正常显示?
- 急,在线等待!
begin
if active then
close ;
sql.clear ;
sql.add('select * from ...');
sql.prepare := true ;
sql.open ;
begin
close ;
sql.clear ;
sql.add('select * from ...');
prepared;
open ;
end;
这是控件用法,其他的方法好像不太行吧,学习中
begin
with TADOQuery.Create(nil) do
begin
try
Connection := ... ; // ConnectionString := ... ;
Sql.Text := s ;
ExecSql ;
Except
end ;
if Active then Active := False ;
Free ;
end ;
end ;每次执行时 , ExecSqlS('...') ;
begin
Result := True ;
with TADOQuery.Create(nil) do
begin
try
Connection := ... ; // ConnectionString := ... ;
Sql.Text := s ;
ExecSql ;
Except
Result := False ;
end ;
if Active then Active := False ;
Free ;
end ;
end ;每次执行时 , ExecSqlS('...') ;
const
ss='select ybtdgl0,YBTZPRQ,cwdzdmc from hpcx,cwdzd where ybtyszl=''1'' and hpcx.ybtfcwd=cwdzd.cwdzddm and hpcx.ybtzprq=''%s''';
begin
with adoqcx do
begin
close;
sql.Clear;
sql.add(format(ss,[formatdatetime('yyyymmdd',Now())]));
open;
adoqcx.First;
while not adoqcx.Eof do
begin
adothpcx1.open;
adothpcx1.append;
adothpcx1.FieldByName('rq').asstring:=adoqcx.FieldByName('YBTZPRQ').AsString;
adothpcx1.FieldByName('cwd').asstring:=adoqcx.FieldByName('cwdzdmc').AsString;
adothpcx1.FieldByName('fjzzl').AsInteger:=adoqcx.FieldByName('ybtdgl0').asinteger;
adoqcx.Next;
end;
adothpcx1.post;
showmessage('提取完成');end;
end;