Program to create aliases for Absolute DB database files

.NET Zip component, Delphi Zip component, Barcode .NET, BDE Replacement and other .NET and Delphi components from ComponentAce
Products Download Order Contact us

Search
 

Delphi/C++ Components
.NET Components
ActiveX Controls
Kylix Components

Download

Download
Download Commercial
Trial Limitations

Support

Submit Request
Support Options

Order

Purchase
Competitive Upgrade
Premium Support
Sales Policy
Upgrade Policy
License Types

Info

News
Mailing List
Articles
Testimonials



About Us
Partners
Links
Contact Us
Link to Us





Home > Program to create aliases for Absolute DB database files

Program to create aliases for Absolute DB databases by Johan Keizer

What I am missing in absolute database is the use of aliases like in bde.
To overcome this, I wrote a little program to create aliases and some (2) functions to retrieve them.
The program can create the aliases and can display a help screen, from which the retrieve functions can be cut to paste them into the application, that needs them.
When you like this, you may use the source and/or program for whatever you want.
For completeness, this is the text of the help:
? ? __________________
?  Help for ABS_Alias
?  __________________
?  Contents:
? ? ?  1 Info
? ? ?  2 Syntax
? ? ?  3 Buttons
? ? ?  4 Functions source

?  1 Info:
? ? ?  This program is used to specify aliases for 'Absolute Database' database
? ? ?  files. An alias is usefull to keep your program independant from the place
? ? ?  of the database.
? ? ?  This program uses function GetABSAliasFilename to retrieve or create
? ? ?  the file that contains the alias information. GetABSAliasFilename
? ? ?  creates an empty file when it did not exist before. Click the 'Cancel'
? ? ?  button and this file will be deleeted.
? ? ?  The file is created in or retrieved from %Local Settings%\ABS_ALias.txt or
? ? ?  when the registry key for 'Local Settings' (unexpectedly) does not exist the
? ? ?  file is created in or retrieved from C:\ABS_ALias.txt.
? ? ?  In your program use the function 'GetABSDbByAlias(Alias)' to get the
? ? ?  databasefilename for your alias. Function GetABSDbByAlias also calls
? ? ?  function GetABSAliasFilename to get the right file.
? ? ?  When the alias is not found in this file, this function returns a
? ? ?  question mark (?), on which you can act as desirable.
? ? ?  The sources of functions GetABSAliasFilename and GetABSDbByAlias are listed
? ? ?  in "4 Functions source" below. You may cut these functions from this
? ? ?  helpfile with +C to the clipboard and paste it into your source file.

?  2 Syntax:
? ? ?  The syntax of this file is only inspected by function GetABSDbByAlias
? ? ?  and not by this program. The lines in the file are inspected by
? ? ?  GetABSDbByAlias whith below rules and no errormessage is given !
? ? ?  Each line in the aliasfile may contain one of the following:
? ? ? ? ?  - No data or only spaces.
? ? ? ? ? ? ? ? ?  These lines are skipped.
? ? ? ? ?  - Data starting with an asterix '*'.
? ? ? ? ? ? ? ? ?  These lines are treated as comment and will be skipped.
? ? ? ? ? ? ? ? ?  Spaces before the asterix are allowed.
? ? ? ? ?  - Data without an equal sign.
? ? ? ? ? ? ? ? ?  These lines are skipped also.
? ? ? ? ?  - A statement in the form alias=databasefilename.
? ? ? ? ? ? ? ? ?  Example: mydb=c:\my dbdir\my db.abs
? ? ? ? ? ? ? ? ?  Spaces around alias and databasefilename are trimmed, although
? ? ? ? ? ? ? ? ?  the spaces within the databasefilename are kept.
? ? ? ? ? ? ? ? ?  So ' mydb?  =?  c:\my dbdir\my db.abs?  ' is (without the quotes)
? ? ? ? ? ? ? ? ?  a valid substitute for above example.
? ? ? ? ? ? ? ? ?  First match will be used.

?  3 Buttons:
? ? ?  in "File mode":
? ? ? ? ?  Ok:? ? ? ?  - Save this file.
? ? ? ? ? ? ? ? ? ? ? ? ?  - If 'file to save' is empty or only contains empty lines,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  then delete it.
? ? ? ? ? ? ? ? ? ? ? ? ?  - Exit program.
? ? ? ? ?  Cancel: - Do not save this file.
? ? ? ? ? ? ? ? ? ? ? ? ?  - If the file was initially empty delete it.
? ? ? ? ? ? ? ? ? ? ? ? ?  - Exit program.
? ? ? ? ?  Help:? ?  - Give usefull information. Go to "Help mode"
? ? ?  in "Help mode":
? ? ? ? ?  Return: - Leave "Help mode" and return to "File mode".

?  4 Functions source:
? ? ?  function?  GetABSAliasFilename: string;
? ? ?  var Reg: TRegistry; TS: TStringList;
? ? ?  begin
? ? ? ? ?  Reg? ? ? ? ? ? ? ? ? ?  := TRegistry.Create;
? ? ? ? ?  Reg.RootKey? ?  := HKEY_CURRENT_USER;
? ? ? ? ?  Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Explorer\'+
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  'Shell Folders',False);
? ? ? ? ?  try
? ? ? ? ? ? ?  result := Reg.ReadString('Local Settings')+'\ABS_ALias.txt';
? ? ? ? ?  except
? ? ? ? ? ? ?  result := 'C:\ABS_ALias.txt';
? ? ? ? ?  end;
? ? ? ? ?  Reg.CloseKey; Reg.Free;
? ? ? ? ?  if not FileExists(result) then
? ? ? ? ? ? ?  begin // Create empty file
? ? ? ? ? ? ? ? ?  TS := TStringList.Create; TS.SaveToFile(result); TS.Free;
? ? ? ? ? ? ?  end;
? ? ?  end;
? ? ?  function?  GetABSDbByAlias(Alias: string): string;
? ? ?  var TS: TStringList; i, p: integer; LineIn, AliasIn, DBIn: string;
? ? ?  begin
? ? ? ? ?  Alias := lowercase(Alias); result := '?';
? ? ? ? ?  TS := TStringList.Create; TS.LoadFromFile(GetABSAliasFilename);
? ? ? ? ?  for i := 0 to TS.Count-1 do
? ? ? ? ?  begin
? ? ? ? ? ? ?  LineIn? ? ? ? ? ? ? ? ? ? ? ?  := lowercase(trim(TS[i]));
? ? ? ? ? ? ?  if LineIn=''? ? ? ? ? ?  then continue;
? ? ? ? ? ? ?  if LineIn[1]='*'? ?  then continue;
? ? ? ? ? ? ?  p? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  := pos('=',LineIn);
? ? ? ? ? ? ?  if p=0? ? ? ? ? ? ? ? ? ? ? ?  then continue;
? ? ? ? ? ? ?  AliasIn? ? ? ? ? ? ? ? ? ? ?  := trim(copy(LineIn,1,p-1));
? ? ? ? ? ? ?  DBIn? ? ? ? ? ? ? ? ? ? ? ? ? ?  := trim(copy(LineIn,p+1,255));
? ? ? ? ? ? ?  if Alias=AliasIn? ?  then begin result := DBIn; break; end;
? ? ? ? ?  end;
? ? ? ? ?  TS.Free;
? ? ?  end;
Kind regards,
Johan Keizer
Koedijk
The Netherlands

See other links:
| FlexCompress .NET | FlexCompress .NET | FlexCompress .NET | EMail.NET Features | EMail.NET Requirements | FlexCompress .NET | ZipForge .NET | ZipForge .NET | ZipForge .NET | ZipForge.NET Features | ZipForge.NET Requirements | ZipForge .NET | Absolute Database Features | Absolute Database Requirements | Absolute Database Screenshots | Absolute DB - additional info | Absolute DB 3rd Party addons | Add a Stream to ZIP archive in C# | Add a Stream to ZIP archive in Delphi | Add a Stream to ZIP archive in VB.NET | ALTER TABLE ADD SQL Example | ALTER TABLE MEMORY SQL Example | ALTER TABLE MODIFY SQL Example | Barcode .NET Features | Barcode .NET Requirements | Batch Move Delphi Example | BDE Administrator Download | Absolute Database | BDE download | Absolute Database | Blob Compression Delphi Example | Blob Fields Delphi Example | Blob Jpeg Field Delphi Example | Blobs In Sql Delphi Example | Zip in C# | Calculated Field Delphi Example | Client Dataset Delphi Example | Compression Master Suite Requirements | Constraints Delphi Example | Copy Table Delphi Example | Create Database Delphi Example | CREATE DROP TABLE SQL Example | CREATE INDEX SQL Example | CREATE INMEMORY TABLE SQL Example | Create Table Delphi Example | Absolute DB | Db Controls Delphi Example | Default Value Delphi Example | Delete a file from ZIP Archive in C# | Delete a file from ZIP Archive in Delphi | Delete a file from ZIP Archive in VB.NET | DELETE SQL Example | Delphi Database Code Samples | Absolute DB | Absolute DB | Absolute DB | ZipForge Features | Delphi Zip Component ZipForge Requirements | ZipForge | ZipForge | Absolute DB | DISTINCT SQL Example | Download BDE | Download BDE Administrator | DROP INDEX SQL Example | Easy Compression Library Features | Easy Compression Library Requirements | ECL for ActiveX Features | ECL for Kylix Features | Encrypted Database Delphi Example | EXCEPT CORRESPONDING SQL Example | Export To Sql Delphi Example | EXPR ARITHMETIC SQL Example | Extract a file from ZIP in C# | Extract a file from ZIP in Delphi | Extract a file from ZIP in VB.NET | Filter Delphi Example | FlexCompress Features | FlexCompress Requirements | FlexCompress.NET Features | FlexCompress.NET Requirements | FlexCompress .NET | FULL JOIN SQL Example | FUNCTION AVG SQL EXAMPLE | FUNCTION CAST SQL Example | FUNCTION COUNT SQL Example | FUNCTION LENGTH SQL Example | FUNCTION LOWER SQL Example | FUNCTION MAX SQL Example | FUNCTION MIN SQL Example | FUNCTION POS SQL Example | FUNCTION SUBSTRING SQL Example | FUNCTION SUM SQL Example | FUNCTION SYSDATE NOW SQL Example | FUNCTION TODATE SQL Example | FUNCTION TOSTRING SQL Example | FUNCTION TRIM SQL Example | FUNCTION UPPER SQL Example | Import Delphi Example | In Memory Table Delphi Example | IN Operator SQL Example | Indexes Delphi Example | INNER JOIN SQL Example | INSERT INTO SQL Example | Last Auto Inc Delphi Example | LEFT JOIN SQL Example | Make Executable Database Delphi Example | Master Detail Delphi Example | Multi Thread Delphi Example | Multi User Delphi Example | NATURAL FULL JOIN SQL Example | Operator BETWEEN SQL Example | Operator LIKE SQL Example | Program to create aliases for Absolute DB database files | Range Delphi Example | Rename File in ZIP archive in C# | Rename File in ZIP archive in Delphi | Rename File in ZIP archive in VB.NET | Repair ZIP archive in C# | Repair ZIP archive in Delphi | Repair ZIP archive in VB.NET | Replace a file in ZIP archive in C# | Replace a file in ZIP archive in Delphi | Replace a file in ZIP archive in VB.NET | Reports Fast Report Delphi Example | Reports Quick Report Delphi Example | Reports Rave Report Delphi Example | Reports Report Builder Delphi Example | Restructure Table Delphi Example | Run Time Components Creation Delphi Example | Search Records Delphi Example | SEARCHED CASE SQL Example | SELECT DIFFERENT DB SQL Example | SELECT FROM 2 TABLES SQL Example | SELECT GROUP BY SQL Example | SELECT HAVING SQL Example | SELECT INTERSECT SQL Example | SELECT INTO SQL Example | SELECT ORDER BY SQL Example | SELECT TOP SQL Example | SELECT UNION SQL Example | Self-extracting ZIP in C# | Self-extracting ZIP in Delphi | Self-extracting ZIP in VB.NET | SIMPLE CASE SQL Example | SIMPLE SELECT SQL Example | Sort Records Delphi Example | SQL Examples | Sql Query Delphi Example | STR CONCAT 2 SQL Example | STR CONCAT SQL Example | SUBQUERY INSERT INTO SQL Example | SUBQUERY SELECT AS FIELD SQL Example | SUBQUERY SELECT FROM SELECT SQL Example | SUBQUERY UPDATE SQL Example | SUBQUERY WHERE COMPARE ALL SQL Example | SUBQUERY WHERE COMPARE ANY SQL Example | SUBQUERY WHERE EQUAL SQL Example | SUBQUERY WHERE EXISTS SQL Example | SUBQUERY WHERE IN SQL Example | Table List Delphi Example | Test ZIP archive in C# | Test ZIP archive in Delphi | Test ZIP archive in VB.NET | Transaction Delphi Example | TRANSACTIONS FLUSH SQL Example | TRANSACTIONS SQL Example | Unicode Delphi Example | Unzip a ZIP file in C# | Unzip a ZIP file in Delphi | Unzip a ZIP file in VB.NET | UPDATE SQL Example | Update ZIP archive in C# | Update ZIP archive in VB.NET | Zip in VB.NET | Web Sql Console Delphi Example | Zip a file in C# | Zip a file in Delphi | Zip a file in VB.NET | Zip a folder in C# | Zip a folder in Delphi | Zip a folder in VB.NET | Zip a stream in C# | Zip a stream in Delphi | Zip a stream in VB.NET | ZIP and comments in C# | ZIP and comments in Delphi | ZIP and comments in VB.NET | ZIP and Progress Indication in C# | ZIP and Progress Indication in Delphi | ZIP and Progress Indication in VB.NET | ZIP and Unicode Filenames in C# | ZIP and Unicode Filenames in VB.NET | ZipForge | ZipForge | ZipForge | Zip files in C# | Zip files in Delphi | Zip files in VB.NET | Zip in Delphi | Zip in Stream in C# | Zip in Stream in Delphi | Zip in Stream in VB.NET | Zip with AES encryption in C# | Zip with AES encryption in Delphi | Zip with AES encryption in VB.NET | ZipForge Transactions in C# | ZipForge Transactions in Delphi | ZipForge Transactions in VB.NET | ZipForge.NET for CF Features | ZipForge.NET for CF Requirements | ZLIB for .NET | Zlib.NET Requirements |

Get a Discount!


If you own a competing product, you may take advantage of
Competitive Upgrade Program
 


Our Customers



Testimonials

Component Ace is all that it advertises. It is easy to implement and is very fast.

In addition, the customer support is the best I have ever had. All my questions were answered within hours, often immediately. The responses also answered my questions, no need for followup emails.

If your application needs the functionality that Component Ace provides, search no further.

Linda Murphy

        © 2003 - 2024 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Oct 06, 2024