我的database是SQL SERVER
下面是我动态创建odbc的代码,怎么能
blob size=128
blobs to cache=256
//*动台写注册表*//
procedure TOdbc_form.Button1Click(Sender: TObject);
var
registry1: TRegistry;
begin
registry1 := tregistry.Create;
registry1.RootKey := HKEY_CURRENT_USER;
if registry1.OpenKey('software/odbc/odbc.ini/odbc data sources', true)
then
begin
registry1.WriteString('hr', 'SQL Server');
registry1.CloseKey;
end;
if registry1.OpenKey('software/odbc/odbc.ini/hr', true) then
begin
registry1.WriteString('Server', combobox1.Text);
registry1.WriteString('Driver', '/odbcjt32.dll');
registry1.WriteString('Database', 'hr');
registry1.WriteString('Lastuser', user.text);
if nt.Checked then
registry1.WriteString('Trusted_Connection', 'yes')
else
registry1.WriteString('Trusted_Connection', 'no');
registry1.WriteString('password', passwd.text);
registry1.WriteInteger('Blob Size',128);
registry1.CloseKey;
end;
if registry1.OpenKey('software/odbc/odbc.ini/hr/Engines/Jet', true)
then
begin
registry1.writeinteger('Blob Size', 128);
end;
registry1.Free;
showmessage('Create Complete');
end;