Board index » delphi » Developing Database Independent Applications

Developing Database Independent Applications

Has anyone developed Delphi applications that are database independent.
If so, any hints on how to achieve that.  I want to write a delphi
application that will work from Access, Paradox to Interbase, Microsoft
SQL Server, Oracle ... etc.

--
Ruben Ramirez
email: rrami...@ix.netcom.com
       rramire...@home.com

(To reply, remove the DEL from header address)

 

Re:Developing Database Independent Applications


In response to:

Quote
> Has anyone developed Delphi applications that are database independent.
> If so, any hints on how to achieve that.  I want to write a delphi
> application that will work from Access, Paradox to Interbase, Microsoft
> SQL Server, Oracle ... etc.

I have done some of this and while its possible, it means you can't use
many of the best features of delphi.  Particularly, you must avoid the use
of any persistent fields.  Instead, use the
Table.FieldByName('ColumnName').AsString  (or .AsFloat, .AsBoolean,
.AsCurrency, .AsInteger methods).  These are real nice methods that
provide great flexibility in type conversions.  

Also, I know Delphi C/S comes with some conversion programs, but I don't
have the $$$ to try them out.  Good luck.

Scott St.Cyr
saint...@aol.com

Re:Developing Database Independent Applications


Hi

Yes, this is posible. Our app runs on Paradox, Btrieve, MSSQL, Oracle,
Informix. As Scott said, never use persistent fields. You might have
problems with DateTime, Date, Time fields. Some DB's only support Date,
Time while others again only Date, DateTime. DO NOT USE AutoIncrement.
{MSSQL and Oracle do not support, but they have someting like rowid}. Do
not use recordcound, it returns 0 on some DB's.

We changed to ODBC Express, No more bugs and much faster and portable. !!!

Hannes

SaintCyr <saint...@aol.com> wrote in article
<19970410184600.OAA14...@ladder01.news.aol.com>...

Quote
> In response to:

> > Has anyone developed Delphi applications that are database independent.
> > If so, any hints on how to achieve that.  I want to write a delphi
> > application that will work from Access, Paradox to Interbase, Microsoft
> > SQL Server, Oracle ... etc.

> I have done some of this and while its possible, it means you can't use
> many of the best features of delphi.  Particularly, you must avoid the
use
> of any persistent fields.  Instead, use the
> Table.FieldByName('ColumnName').AsString  (or .AsFloat, .AsBoolean,
> .AsCurrency, .AsInteger methods).  These are real nice methods that
> provide great flexibility in type conversions.  

> Also, I know Delphi C/S comes with some conversion programs, but I don't
> have the $$$ to try them out.  Good luck.

> Scott St.Cyr
> saint...@aol.com

Re:Developing Database Independent Applications


Never tried it but I guess by using SQL commands u can do that. The
difficulties will be when you will select proper alias and use correct
drivers. I guess Client/server version of Delphi can do that easily with
its native support for various SQL servers but how about ODBC connection?

This is the way one can create an alias at runtime:

procedure TDataModule2.DataModule2Create(Sender: TObject);
Var FilDir : String;
begin
FilDir := GetCurrentDir;
     with session do
     begin
          ConfigMode := cmSession;
          try
          AddStandardAlias('MyAlias', FilDir+'\Data\', 'Paradox');
          finally
          end;
     end;
table1.Open;
end;

What also could be interesting is how one can create an ODBC connection
during runtime... if its possible...

Ruben <DELrrami...@ix.netcom.com> skrev i inl?gg
<334C8362.3...@ix.netcom.com>...

Quote
> Has anyone developed Delphi applications that are database independent.
> If so, any hints on how to achieve that.  I want to write a delphi
> application that will work from Access, Paradox to Interbase, Microsoft
> SQL Server, Oracle ... etc.

--
_____________________________________________________________________

Quote of the week (#15):
"...That sweet little girl that live down the street,
some people think shes square by I think shes sweet,
you can see everyday going up and down the way,
lookin so pretty and this is what she say..."

_/\
_|:o) >>>>>>>>>> no_spam_mail2f...@hotmail.com_no_spam <<<<<<<<<<<<
  \/

(Remove no spam when mailing me)

Visit my home @:
http://home3.swipnet.se/~w-33398/ {Under construction}

Visit the World of Links @:
http://home3.swipnet.se/~w-33398/world/world.html
(Links to Delphi, SQL, ActiveX, Java et c)
_____________________________________________________________________

Other Threads