?? kqglcommon.pas
字號:
unit KqglCommon;
interface
uses
Windows, SysUtils, Registry, DB, DBGrids;
resourcestring
conKqglDataFile = 'Data\Kqgl.mdb';
var
EXEPath: string; //主程序路徑
function GetExePath: string;
function Create_ODBC_Access(const ODBCName: string): boolean;
implementation
function GetExePath: string;
begin
Result := ExtractFilePath(ParamStr(0));
end;
function Create_ODBC_Access(const ODBCName: string): boolean;
var
RegisterTemp : TRegistry;
SystemPath: array [0..255] of char;
StrSystemPath: string;
begin
Result := False;
RegisterTemp := TRegistry.Create;
with RegisterTemp do
begin
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey('Software\ODBC\ODBC.INI\ODBC Data Sources', True) = False then
CloseKey
else
begin
WriteString(ODBCName, 'Microsoft Access Driver (*.mdb)');
CloseKey;
if OpenKey('Software\ODBC\ODBC.INI\' + ODBCName, True) then
begin
GetSystemDirectory(SystemPath, 255);
StrSystemPath := SystemPath;
StrSystemPath := Trim(StrSystemPath);
WriteString( 'DBQ', EXEPath + conKqglDataFile );
WriteString( 'Driver', StrSystemPath + '\odbcjt32.dll' );
WriteInteger( 'DriverId', 25 );
WriteString( 'FIL', 'MS Access;' );
WriteInteger( 'SafeTransactions', 0 );
WriteString( 'UID', '' );
CloseKey;
Result := True;
end;
end;
Free;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -