Subject Re: [ib-support] Re: win98 firebird connections
Author Woody
From: "Jill Thomson" <jthomson@...>
> A member of this list contributed a solution to this problem in January.
It
> involves making a temporary change to a registry setting. Now where did I
> file It? :>(

here is a copy of the post (I knew it would come in handy someday :)

<<<<<<<<<<
Hi,

i use the code below to stop this happening when i connect to the database,
something like this may fix your problem.

ie.
StoredSetting:=StopDialUpAutoDial();
try
Database.Open();
finally
RestoreDialUpAutoDial(StoredSetting);
end; //of try..finally


the full function source is below...

{-------------------------------------------------------}
{-------------------------------------------------------}
function StopDialUpAutoDial:longint;
const
RegPath = 'Software\Microsoft\Windows\CurrentVersion\Internet Settings';
EnableAutoDial = 'EnableAutoDial';
DisableIt:Longint = 0;
var
Registry:TRegistry;
RegistryOldSetting:longint;
begin
StopDialUpAutoDial:=0;
if Win32Platform<>VER_PLATFORM_WIN32_NT then
begin
try
try
Registry:=TRegistry.Create();
if Registry.OpenKey(RegPath,false) then
begin

Registry.ReadBinaryData(EnableAutoDial,RegistryOldSetting,sizeof(RegistryOld
Setting));
StopDialUpAutoDial:=RegistryOldSetting;
if RegistryOldSetting<>DisableIt
then
Registry.WriteBinaryData(EnableAutoDial,DisableIt,sizeof(DisableIt));
end; //of if
finally
if assigned(Registry) then Registry.Free;
end; //of try..finally
except //catch all
end; //of try except
end; //of if
end; //of procedure StopDialUpAutoDial

{-------------------------------------------------------}
{-------------------------------------------------------}
procedure RestoreDialUpAutoDial(OldValue:longint);
const
RegPath = 'Software\Microsoft\Windows\CurrentVersion\Internet Settings';
EnableAutoDial = 'EnableAutoDial';
var
Registry:TRegistry;
RegistrySetting:longint;
begin
if Win32Platform<>VER_PLATFORM_WIN32_NT then
begin
try
try
Registry:=TRegistry.Create();
if Registry.OpenKey(RegPath,false) then
begin

Registry.ReadBinaryData(EnableAutoDial,RegistrySetting,sizeof(RegistrySettin
g));
if RegistrySetting<>OldValue
then
Registry.WriteBinaryData(EnableAutoDial,OldValue,sizeof(OldValue));
end; //of if
finally
if assigned(Registry) then Registry.Free;
end; //of try..finally
except //catch all
end; //of try except
end; //of if
end; //of procedure RestoreDialUpAutoDial


Kind regards, Pete Bray
pete@...