with UntPub.myAdoQuery do
begin
close;
sql.clear;
strSQL:='select Pass from syms.USER_LIST where USERID=''' +trim(self.EUser.text)+'''';
sql.add(strsql);
//test
if myAdoQuery.Connection.Connected=true then//判断是否已经连接上
begin
untpub.MsgBox(myAdoQuery.SQL.Text);//把sql语句显示出来
txtSql.Text:=myAdoQuery.SQL.Text;
end;
open;
first;
if myAdoquery.IsEmpty=true then //判断结构是否为空
untpub.MsgBox('结果为空!');
if RecordCount<1 then
begin
untpub.MsgBox('用户'+trim(self.EUser.text)+'不存在!');
close;
exit;
end;
各位高手帮帮忙,看看我这个问题出现在哪了,数据库已经连接上了,但在Open后myAdoquery为空,是sql语句出了问题吗?但是在pl、sql里面执行没有问题啊
begin
close;
sql.clear;
strSQL:='select Pass from syms.USER_LIST where USERID=''' +trim(self.EUser.text)+'''';
sql.add(strsql);
//test
if myAdoQuery.Connection.Connected=true then//判断是否已经连接上
begin
untpub.MsgBox(myAdoQuery.SQL.Text);//把sql语句显示出来
txtSql.Text:=myAdoQuery.SQL.Text;
end;
open;
first;
if myAdoquery.IsEmpty=true then //判断结构是否为空
untpub.MsgBox('结果为空!');
if RecordCount<1 then
begin
untpub.MsgBox('用户'+trim(self.EUser.text)+'不存在!');
close;
exit;
end;
各位高手帮帮忙,看看我这个问题出现在哪了,数据库已经连接上了,但在Open后myAdoquery为空,是sql语句出了问题吗?但是在pl、sql里面执行没有问题啊
解决方案 »
- 怎么忽悠一个人让他学DELPHI啊?DELPHI有什么好的~~,都来说说~~~~~~~~
- 用Sql 语句求字段(一列)和, 但是....... 如下:
- VclSkin 2.45 怎么在Delphi2007中安装?
- 取整和取余?
- 有办法确定当前鼠标所在 dbgrid 的哪一列吗?
- 排序后不能更新的问题?
- 从DBGridEh导出数据到.XLS文件或者HTM文件(代码已给出,但有错误)
- 請教一個關于用bde方式連接的程序的打包問題﹐望能指點...
- 请问TFileStream,TMemoryStream,TblobStream有什么区别
- delphi于*.gif动画的问题
- delphi+oralce开发的系统怎么打包
- 如何不让应用程序在任务栏上显示
应该类似这样
select * from syms.USER_LIST where USERID= YourID
//.....
if myAdoquery.IsEmpty then //用户不存在
else
begin
//取密码
Pass := FieldByName('Pass').AsString;
end
看我下面这段代码,应该不是你说的问题
with UntPub.myAdoQuery do
begin
close;
sql.clear;
strSQL:='select Pass from syms.USER_LIST where USERID=''' +trim(self.EUser.text)+'''';
sql.add(strsql);
//test
if myAdoQuery.Connection.Connected=true then//判断是否已经连接上
begin
untpub.MsgBox(myAdoQuery.SQL.Text);//把sql语句显示出来
txtSql.Text:=myAdoQuery.SQL.Text;
end;
open;
first;
if myAdoquery.IsEmpty=true then //判断结构是否为空
untpub.MsgBox('结果为空!');
if RecordCount <1 then
begin
untpub.MsgBox('用户'+trim(self.EUser.text)+'不存在!');
close;
exit;
end;
灰色部分只是我用来查看程序运行过程的