procedure TForm1.Button1Click(Sender: TObject);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.OpenKey('/Software/odbc/odbc.ini', True);
reg.CreateKey('gong2');
Reg.OpenKey('/Software/odbc/odbc.ini/gong2', True);
Reg.WriteString('DBQ','E:/gong.mdb');
Reg.WriteString('Driver','C:/WINNT/System32/odbcjt32.dll');
reg.WriteInteger('DriverId',25);
Reg.WriteString('FIL','MS Access;');
Reg.WriteString('UID','');
reg.WriteInteger('SafeTransactions',0);
reg.CreateKey('Engines');
Reg.OpenKey('/Software/odbc/odbc.ini/gong2/Engines', True);
reg.CreateKey('Jet');
Reg.OpenKey('/Software/odbc/odbc.ini/gong2/Engines/Jet', True);
Reg.WriteString('ImplicitCommitSync','');
Reg.WriteString('UserCommitSync','Yes');
reg.WriteInteger('MaxBufferSize',2048);
reg.WriteInteger('PageTimeout',5);
reg.WriteInteger('Threads',3);
Reg.OpenKey('/Software/odbc/odbc.ini/ODBC Data Sources', True);
Reg.WriteString('gong2','Microsoft Access Driver (*.mdb)');
Reg.CloseKey ;
reg.Free;
给分!