procedure Tlogform.Button1Click(Sender: TObject);
begin
try
if dm.conn.Connected=true then
dm.conn.Connected:=false;
dm.conn.Open;
dm.manager_adoqry.Connection:=dm.conn;
dm.manager_adoqry.Active:=true; dm.manager_adoqry.close;
dm.manager_adoqry.sql.clear;
dm.manager_adoqry.sql.add('select * from manager where username='+''''+nameedt.text+''''+' and managerpwd='+''''+passwdedt.text+''''+' and power='+''''+'3'+'''');
dm.manager_adoqry.open; if dm.manager_adoqry.recordcount=1 then
showmessage('yes')
else showmessage('no');
except showmessage('53');
end;
end;
用adoconnection和adoquery做的cs机构。
这是登陆窗口,可是老是 提示:
project manage.exe raised exception class eaccessviolation with message 'access violation at addree 046e9c2 in module 'manage.exe'.read of address oooooo50'.process stopped .use step or run to contnue.谢谢,虚心请教,分不够再加!
begin
try
if dm.conn.Connected=true then
dm.conn.Connected:=false;
dm.conn.Open;
dm.manager_adoqry.Connection:=dm.conn;
dm.manager_adoqry.Active:=true; dm.manager_adoqry.close;
dm.manager_adoqry.sql.clear;
dm.manager_adoqry.sql.add('select * from manager where username='+''''+nameedt.text+''''+' and managerpwd='+''''+passwdedt.text+''''+' and power='+''''+'3'+'''');
dm.manager_adoqry.open; if dm.manager_adoqry.recordcount=1 then
showmessage('yes')
else showmessage('no');
except showmessage('53');
end;
end;
用adoconnection和adoquery做的cs机构。
这是登陆窗口,可是老是 提示:
project manage.exe raised exception class eaccessviolation with message 'access violation at addree 046e9c2 in module 'manage.exe'.read of address oooooo50'.process stopped .use step or run to contnue.谢谢,虚心请教,分不够再加!
解决方案 »
- 如何让Edit具有Label的Alignment属性的功能
- DBGridEH与XPManifest的问题
- 有关双摄像头的编程问题,急... ,在线等待
- 请问:如何删除TreeView节点以及其子节点
- 请教DELPHI高手,如何让程序在非XP系统中使用XP的风格界面?
- 如何建函数(前五名解答者各二十分,以不重复且正确为准)。
- 怎样关闭数据库连接???
- 那位有短信息系统方案,高分请教
- 怎样使qreport报表在生成应用程序后,还能对报表控件进行调整,就像fastreport的frDesigner的功能一样!
- 文件读取I/O ERROR 32问题
- 我正在开发一个类似VAJ的java调试工具,功能差不多,调试功能可以与JBuilder相比
- delphi数据访问控件的Bug,该如何办?
dm.manager_adoqry.open;之后!
dm.manager_adoqry.Active:=true; 去掉dm.manager_adoqry.open; 改为dm.manager_adoqry.Active:=true;
dm.manager_adoqry.Active:=true 不需要,可删除!
2.设置断点后,跟踪调试!
我用断点调试过了,在第一个if语句就报那样的错了。你的方法也试过了,不行。
回:cbdiy(··V-R战警··)
你说的我也试过了,还是不行。麻烦各位老大再努力想想,虚心请教!
怎么样升级ado?重要吗?
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TDataModule2, DataModule2);
Application.Run;如果在主窗体的Create中建立了登录窗体,再在登录窗体中用数据集就会出错
program Project1;uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {DataModule2: TDataModule};{$R *.res}begin
Application.Initialize;
Application.CreateForm(TDataModule2, DataModule2);//数据模块
Application.CreateForm(TForm1, Form1); Application.Run;
end.
再在设计期激活或打开DM窗体,试试。
或者在Porject Options\Forms中是否列入自动创建(Auto-Create Forms)列表中
我所说的就是你这种情况,用的是datamodule,而且是在主窗体的Create中建立登陆窗口。
logform:=Tlogform.create(self);
logform.showmodal;
然后再在登录窗体中用数据集的,请问各位高手,有没有什么解决的办法?虚心请教!!!
Application.CreateForm(TDataModule2, DataModule2);//数据模块
确保在DataModule2创建后在调用
logform:=Tlogform.create(self);
logform.showmodal;