S
seraphcj
Unregistered / Unconfirmed
GUEST, unregistred user!
如果我的dll这样写的:
(如下)但是运行时候告诉我非法读取。。。violent access...怎么办呢?。。。
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
Grids,
DBGrids,
DB,
DBClient,
MConnect,
StdCtrls,
DBTables,
Buttons,
ExtCtrls,
DBCtrls,
Menus,
ImgList,
ComCtrls;
{$R *.res}
procedure add_key(clientdataset:tclientdataset;str1:string;lock_unlock :char); //对锁定码处理的核心函数
begin
clientdataset.Open; //打开到第一条纪录
clientdataset.First;
with clientdataset do
begin
while not EOF do
begin
edit;
if (lock_unlock = ’L’) or (lock_unlock = ’R’)then //如果是要求锁定,则加载用户此时的锁定码
begin
if( fieldValues[’lockcode’] = null) or (fieldValues[’lockcode’] = ’’ ) then
begin
fieldValues[’lockcode’]:= str1;
post;
end;
end
else if lock_unlock = ’U’ then //解锁锁定码
begin
if( fieldValues[’lockcode’] = str1 ) then
begin
fieldValues[’lockcode’]:= ’’;
post;
end;
end;
next;
end;
end;
end;
exports
add_key;
begin
end.
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
(如下)但是运行时候告诉我非法读取。。。violent access...怎么办呢?。。。
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
Grids,
DBGrids,
DB,
DBClient,
MConnect,
StdCtrls,
DBTables,
Buttons,
ExtCtrls,
DBCtrls,
Menus,
ImgList,
ComCtrls;
{$R *.res}
procedure add_key(clientdataset:tclientdataset;str1:string;lock_unlock :char); //对锁定码处理的核心函数
begin
clientdataset.Open; //打开到第一条纪录
clientdataset.First;
with clientdataset do
begin
while not EOF do
begin
edit;
if (lock_unlock = ’L’) or (lock_unlock = ’R’)then //如果是要求锁定,则加载用户此时的锁定码
begin
if( fieldValues[’lockcode’] = null) or (fieldValues[’lockcode’] = ’’ ) then
begin
fieldValues[’lockcode’]:= str1;
post;
end;
end
else if lock_unlock = ’U’ then //解锁锁定码
begin
if( fieldValues[’lockcode’] = str1 ) then
begin
fieldValues[’lockcode’]:= ’’;
post;
end;
end;
next;
end;
end;
end;
exports
add_key;
begin
end.
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈