W
wecluo
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button4Click(Sender: TObject);
var reg:tregistry;
begin
reg:=tregistry.create;
reg.RootKey:=hkey_local_machine;
if reg.OpenKey('/software/odbc/odbc.ini/odbc data sources',true) then
reg.writestring(edit2.text,'microsoft access driver (*.mdb)');
if reg.OpenKey('/software/odbc/odbc.ini',true) then
reg.CreateKey('''+edit2.text+''');
if reg.OpenKey('/software/odbc/odbc.ini/edit2.text',true) then
begin
reg.createkey('engines');
reg.WriteString('dbq',edit1.text);
reg.WriteString('driver',edit3.text);
reg.Writeinteger('driverid',25);
reg.WriteString('fil','MS Access;');
reg.Writeinteger('safetransactions',0);
reg.WriteString('uid','');
end;
if reg.openkey('/software/odbc/odbc.ini/edit2.text/engines',true) then
reg.createkey('jet');
if reg.OpenKey('/software/odbc/odbc.ini/edit2.Text/engines/jet',true) then
begin
reg.WriteString('implicitcommitsync','');
reg.writeinteger('maxbuffersize',512);
reg.Writeinteger('pagetimeout',10);
reg.Writeinteger('threads',3);
reg.WriteString('usercommitsync','yes');
end;
reg.Free;
showmessage('创建成功');
edit1.Text:='';
end;
var reg:tregistry;
begin
reg:=tregistry.create;
reg.RootKey:=hkey_local_machine;
if reg.OpenKey('/software/odbc/odbc.ini/odbc data sources',true) then
reg.writestring(edit2.text,'microsoft access driver (*.mdb)');
if reg.OpenKey('/software/odbc/odbc.ini',true) then
reg.CreateKey('''+edit2.text+''');
if reg.OpenKey('/software/odbc/odbc.ini/edit2.text',true) then
begin
reg.createkey('engines');
reg.WriteString('dbq',edit1.text);
reg.WriteString('driver',edit3.text);
reg.Writeinteger('driverid',25);
reg.WriteString('fil','MS Access;');
reg.Writeinteger('safetransactions',0);
reg.WriteString('uid','');
end;
if reg.openkey('/software/odbc/odbc.ini/edit2.text/engines',true) then
reg.createkey('jet');
if reg.OpenKey('/software/odbc/odbc.ini/edit2.Text/engines/jet',true) then
begin
reg.WriteString('implicitcommitsync','');
reg.writeinteger('maxbuffersize',512);
reg.Writeinteger('pagetimeout',10);
reg.Writeinteger('threads',3);
reg.WriteString('usercommitsync','yes');
end;
reg.Free;
showmessage('创建成功');
edit1.Text:='';
end;