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里面执行没有问题啊
解决方案 »
- 计算1-30列中所有行中不等于空的算法
- delphi调VC++
- DLL的ADODateSet使用主程序内的ADOConnection?
- 我怎么得到DBGRID的一个单元格中修改后保存前的值 ====在线等
- 用ADO连接数据库怎样取出表的名称和字段名
- 谁有完成端口通讯程序的Delphi源码?
- 请问大侠们,发送什么消息可以让“打开”或“保存”等有路径选择的对话框改变路径?
- 播放pcm文件,控件也行
- 编译出现错误:“9991 2707 Unknown table type.”
- delphi中是否有类似vb中Driverlist之类的控件?
- 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;
灰色部分只是我用来查看程序运行过程的