Board index » delphi » Dephi Database application for cd -

Dephi Database application for cd -

I am currently interested in developing a database application in delphi
version 1 to be distributed on cd-rom.  The database files should be
supplied on the cd, as well as the database engine (BDE).

What I want to know is this.

1.      Knowing that CD rom drives will not always be the same drive
letter, does anyone know how to make the database's alias flexible?
That is, how could I check for the computer's cd-rom drive letter, and
set the datasource alias to that?

2.      I would like the cd to be as little hassle as possibe for end-
users.  Is there any way to run the BDE from the cd (without installing
to the hard drive), possibly by telling win.ini that the engine is
there?.  Is there a way of just executing the bde (perhaps initialised
from within Delphi) without installing it?

3.      I am trying to search a record by using a standard text edit box
and on onChange handler, and I would like it to check for one of seven
fields in the record.  That is, if the text matches any one of these
seven fields in a record, that record will be the search result.  All
seven of these fields are key fields, and the rest are set as non-key
fields (using paradox 5), however, only the first of these fields reacts
to the search.  Does anyone know how to search the other six also?

4.      Relating to the last point, could I also set up a text edit box
to search for an eighth field (ie. could I use edit1.Text to search for
one of field1 to field7, and/or also use edit2.Text to search for
field8)?

Any replies would be greatly appreciated.

Thanks

Richard.
--
Alchemedia Interactive Ltd
"Reality is an illusion caused by a lack of {*word*63}"

 

Re:Dephi Database application for cd -


In article <iu$qcBA2jDvxE...@alchemedia.co.uk>, Alchemedia Interactive
Ltd <nat...@alchemedia.co.uk> writes

Quote
>I am currently interested in developing a database application in delphi
>version 1 to be distributed on cd-rom.  The database files should be
>supplied on the cd, as well as the database engine (BDE).

>What I want to know is this.

>1.      Knowing that CD rom drives will not always be the same drive
>letter, does anyone know how to make the database's alias flexible?
>That is, how could I check for the computer's cd-rom drive letter, and
>set the datasource alias to that?

You don't have to use aliases. You can set all your tables to use the
same Database component, and set its AliasName to the directory you wish
to use (e.g. 'e:\data'). If you do need to change BDE Aliases in code,
here's what I use (modified from a help file example) - note that it
only works with an existing Alias (for new aliases see DBIAddAlias):

procedure fDbiChangeAlias(AliasName, AliasPath: String);
var strzAliasName,strzAliasPath : array[0..255] of Char;
var Handle : hDBICur;
var Config : CFGDESC;
var strzNode : array [0..4] of Char;
begin
  StrPCopy(strzAliasName,Uppercase('\Databases\'+AliasName+'\DB Info'));
  StrPCopy(strzNode,'PATH');
  Check(DBiOpenCfgInfoList(Nil,dbiReadWrite,cfgPersistent,strzAliasName,
Handle));
  repeat
  until (StrIComp(Config.szNodeName,'PATH')=0) or
        (DBIGetNextRecord(Handle,dbiNolock,@Config,Nil) <> DBIErr_None);
  if StrIComp(Config.szNodeName,'PATH')=0 then begin
     StrPCopy(Config.szValue,AliasPath);
     Check(DBiModifyRecord(Handle,@Config,True));
  end;
end;

If anyone can think of an easier way, I'd like to know.

Mark

Mark Williams                   M...@polyhdrn.demon.co.uk
Polyhedron Software Ltd.        
Programs for Programmers - QA, Compilers, Graphics
************ Visit our Web site on http://www.polyhedron.co.uk/ ************

Other Threads