云
云能天
Unregistered / Unconfirmed
GUEST, unregistred user!
我想编写一个自动生成别名的DLL文件.但是在编写的过程中,出现了错误.还请高手帮助看一下.提示是
http://img670.photo.163.com/lijun9701/6827028/2317206555.jpg
程序的源码如下,请各位帮我看看,问题出在哪里?
library ODBC;
uses
SysUtils,
Classes,
StdCtrls,
Windows,
Messages,
Variants,
Graphics,
Controls,
Registry,
Dialogs,
message in 'message.pas' {Form1};
{$R *.res}
procedure mdbodbc(filename:shortstring);stdcall;
var
registerTemp:TRegistry;
bData : array[ 0..0 ] of byte;
begin
if FileExists(filename) then
begin
registerTemp := TRegistry.Create;
with registerTemp do
begin
RootKey:=HKEY_LOCAL_MACHINE;
if OpenKey('Software/ODBC/ODBC.INI/ODBC Data Sources',True) then
begin
WriteString( 'junqi', 'Microsoft Access Driver (*.mdb)' );
end
else
begin
exit;
end;
CloseKey;
if OpenKey('Software/ODBC/ODBC.INI/DMGC',True) then
begin
WriteString( 'DBQ',filename);
WriteString( 'Description', '空气质量预报');
WriteString( 'Driver', 'C:/windows/SYSTEM32/odbcjt32.dll');
WriteInteger( 'DriverId', 25 );
WriteString( 'FIL', 'junqi' );
WriteInteger( 'SafeTransaction', 0 );
WriteString('UID','' );
bData[0] := 0;
WriteBinaryData('Exclusive', bData, 1);
WriteBinaryData('ReadOnly', bData, 0);
end
else
begin
exit;
end;
CloseKey;
if OpenKey('Software/ODBC/ODBC.INI/DMGC/Engines/Jet',True) then
begin
WriteString('ImplicitCommitSync', 'Yes');
WriteInteger( 'MaxBufferSize', 512 );
WriteInteger( 'PageTimeout', 10 );
WriteInteger( 'Threads', 3 );
WriteString( 'UserCommitSync', 'Yes' );
end
else
begin
exit;
end;
CloseKey;
Free;
end;
end;
end;
end.
http://img670.photo.163.com/lijun9701/6827028/2317206555.jpg
程序的源码如下,请各位帮我看看,问题出在哪里?
library ODBC;
uses
SysUtils,
Classes,
StdCtrls,
Windows,
Messages,
Variants,
Graphics,
Controls,
Registry,
Dialogs,
message in 'message.pas' {Form1};
{$R *.res}
procedure mdbodbc(filename:shortstring);stdcall;
var
registerTemp:TRegistry;
bData : array[ 0..0 ] of byte;
begin
if FileExists(filename) then
begin
registerTemp := TRegistry.Create;
with registerTemp do
begin
RootKey:=HKEY_LOCAL_MACHINE;
if OpenKey('Software/ODBC/ODBC.INI/ODBC Data Sources',True) then
begin
WriteString( 'junqi', 'Microsoft Access Driver (*.mdb)' );
end
else
begin
exit;
end;
CloseKey;
if OpenKey('Software/ODBC/ODBC.INI/DMGC',True) then
begin
WriteString( 'DBQ',filename);
WriteString( 'Description', '空气质量预报');
WriteString( 'Driver', 'C:/windows/SYSTEM32/odbcjt32.dll');
WriteInteger( 'DriverId', 25 );
WriteString( 'FIL', 'junqi' );
WriteInteger( 'SafeTransaction', 0 );
WriteString('UID','' );
bData[0] := 0;
WriteBinaryData('Exclusive', bData, 1);
WriteBinaryData('ReadOnly', bData, 0);
end
else
begin
exit;
end;
CloseKey;
if OpenKey('Software/ODBC/ODBC.INI/DMGC/Engines/Jet',True) then
begin
WriteString('ImplicitCommitSync', 'Yes');
WriteInteger( 'MaxBufferSize', 512 );
WriteInteger( 'PageTimeout', 10 );
WriteInteger( 'Threads', 3 );
WriteString( 'UserCommitSync', 'Yes' );
end
else
begin
exit;
end;
CloseKey;
Free;
end;
end;
end;
end.