strTemp:='select customer_no' + 'from customer_file ';
with adoquery1 do
begin
CursorLocation:=clUseServer;
CursorType:=ctOpenForwardOnly;
LockType:=ltReadOnly;
Connection:=cnnOracle;
CacheSize:=200;
CommandTimeout:=60;
SQL.Clear;
SQL.Add(strTemp);
DisableControls;
Active:=true;
end;
请问我想知道customer_no='0001'的记录存在否怎么写?
我这样adoquery1.FindField('customer_no').Value='0001' 找不到,但是
明明有这条记录的?请帮帮我。
with adoquery1 do
begin
CursorLocation:=clUseServer;
CursorType:=ctOpenForwardOnly;
LockType:=ltReadOnly;
Connection:=cnnOracle;
CacheSize:=200;
CommandTimeout:=60;
SQL.Clear;
SQL.Add(strTemp);
DisableControls;
Active:=true;
end;
请问我想知道customer_no='0001'的记录存在否怎么写?
我这样adoquery1.FindField('customer_no').Value='0001' 找不到,但是
明明有这条记录的?请帮帮我。
解决方案 »
- DELPHI 图片显示闪屏问题。
- delphi里怎样对字符串进行urlencode编码?像asp里的server.urlencode
- 调用VC写的DLL出现问题~~~求救各位
- 请问怎样用Delphi7连接Oracle?
- 为什么我中止程序时,老是出现CPU调试界面。
- 对于A/B所得的浮点数怎样取小数点后2位
- pc→单片机的串口通讯,使用spcomm控件,发送时好时坏,怀疑是pc与单片机不同步,应该怎么调?
- ado的一个非常非常简单问题(关于oracle查询)
- dll中怎么设置定时器(settimer),或实现定时器功能?
- 请问各位朋友, PB 和 delphi哪个是数据库开发的强手呢? 只说数据库方面。
- 请问THeapStatus有意思是什么啊
- 有谁知道怎样加载一个控件?
with adoquery1 do
begin
DisableControls;
Close;
SQL.Clear;
SQL.Add(strTemp);
Active:=true;
EnableControls;
end;
在delphi6以上版本用:adoquery1.Parameters.ParamByName('customer_no').Value='0001'在delphi6以下版本用:
adoquery1.parambyname('customer_no').asstring='0001'
with adoquery1 do
begin
CursorLocation:=clUseServer;
CursorType:=ctOpenForwardOnly;
LockType:=ltReadOnly;
Connection:=cnnOracle;
CacheSize:=200;
CommandTimeout:=60;
Close;
SQL.Clear;
SQL.Add(strTemp);
Parameters[0].value := '0001'
DisableControls;
Active:=true;
end;
+'=:no';
....................
params[0].value:= '0001'
ShowMessage('紀錄沒有找到.');
with adoquery1 do
begin
CursorLocation:=clUseServer;
CursorType:=ctOpenForwardOnly;
LockType:=ltReadOnly;
Connection:=cnnOracle;
CacheSize:=200;
CommandTimeout:=60;
Close;
SQL.Clear;
SQL.Add(strTemp);
Parameters[0].values := '0001'
DisableControls;
Active:=true;
end;
2。如果在现有的记录中查找用LOCATE方法
with adoquery1 do
begin
CursorLocation:=clUseServer;
CursorType:=ctOpenForwardOnly;
LockType:=ltReadOnly;
Connection:=cnnOracle;
CacheSize:=200;
CommandTimeout:=60;
Close;
SQL.Clear;
SQL.Add(strTemp);
Parameters[0].value := '0001'
DisableControls;
Active:=true;
end;
with adoquery1 do
begin
CursorLocation:=clUseServer;
CursorType:=ctOpenForwardOnly;
LockType:=ltReadOnly;
Connection:=cnnOracle;
CacheSize:=200;
CommandTimeout:=60;
SQL.Clear;
SQL.Add(strTemp);
DisableControls;
Active:=true;
while not eof do
begin
if adoquery1.fieldbyname('coustomer_no').asstring='0001' then
begin
showmessage('有这条纪录');
break;
end
else
next;
end;
end;
这样你试试看!
adoquery1.sql.add('select * from table where customer_no='0001');
adoquery1.sql.open;
if eof then
no
with adoquery1 do
begin
CursorLocation:=clUseServer;
CursorType:=ctOpenForwardOnly;
LockType:=ltReadOnly;
Connection:=cnnOracle;
CacheSize:=200;
CommandTimeout:=60;
Close;
SQL.Clear;
SQL.Add(strTemp);
Parameters[0].values := '0001'
DisableControls;
Active:=true;
end;