Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
procedure EnsureDataPath(AODBC, ADescription, ADatabase, AAlias: String);
const
ODBCKey = '\SOFTWARE\ODBC\ODBC.INI';
var
s : String;
l : TStringList;
begin
with TRegistry.Create do
try
RootKey := HKEY_LOCAL_MACHINE;
if not OpenKey(ODBCKey + '\' + AODBC, False) then // ODBC entry has not been set up
begin
OpenKey(ODBCKey + '\' + AODBC + '\Engines\Jet', True);
WriteString('ImplicitCommitSync', '');
WriteInteger('MaxBufferSize', 2048);
WriteInteger('PageTimeout', 5);
WriteInteger('Threads', 3);
WriteString('UserCommitSync', 'Yes');
CloseKey;
OpenKey(ODBCKey + '\ODBC Data Sources', True);
WriteString(AODBC, 'Microsoft Access Driver (*.mdb)');
CloseKey;
OpenKey(ODBCKey + '\' + AODBC, True); // create key
s := '\System';
if UpperCase(GetEnvironmentVariable('OS')) = 'WINDOWS_NT' then
s := s + '32';
WriteString('Driver', GetEnvironmentVariable('WINDIR') + s + '\odbcjt32.dll');
WriteInteger('DriverId', 25);
WriteString('FIL', 'MS Access;');
WriteInteger('SafeTransactions', 0);
WriteString('UID', '');
WriteString('Description', ADescription);
end;
WriteString('DBQ', ExtractFilePath(ParamStr(0)) + ADatabase + '.mdb');
CloseKey;
finally
Free;
end;
if not Session.IsAlias(AAlias) then { BDE Alias doesn't exist }
begin
l := TStringList.Create;
try
l.Append('DATABASE NAME=');
l.Append('USER NAME=');
l.Append('ODBC DSN=' + AODBC);
l.Append('OPEN MODE=READ/WRITE');
l.Append('SCHEMA CACHE SIZE=8');
l.Append('SQLQRYMODE=');
l.Append('LANGDRIVER=');
l.Append('SQLPASSTHRU MODE=SHARED AUTOCOMMIT');
l.Append('SCHEMA CACHE TIME=-1');
l.Append('MAX ROWS=-1');
l.Append('BATCH COUNT=200');
l.Append('ENABLE SCHEMA CACHE=FALSE');
l.Append('SCHEMA CACHE DIR=');
l.Append('ENABLE BCD=FALSE');
l.Append('ROWSET SIZE=20');
l.Append('BLOBS TO CACHE=64');
Session.AddAlias(AAlias, 'Microsoft Access Driver (*.mdb)', l);
finally
l.Free;
end;
end;
end;
WriteString('DBQ', ExtractFilePath(ParamStr(0)) + ADatabase + '.mdb');
WriteString('DBQ', ADatabase);