Board index » delphi » Setting up ODBC parameters

Setting up ODBC parameters

Can anyone tell me where I can find a good overview of setting up ODBC
connections from within a Delphi application?  For example, I am connecting
to an existing SQL Anywhere ODBC datasource from within my Delphi app, but
I must go to the ODBC Control Panel applet to change the settings for the
DSN.  It would be much more convenient (and friendlier to the end-user) if
these settings could be changed from within the application.

TIA
--
  Jim Carr <c...@vr.net>
  Cohesive Computer Services
  Dayton, Ohio

  Visit our web page at www.vr.net/~ccs

 

Re:Setting up ODBC parameters


In article <01bc71c4$ab569c40$09da0280@carr>, Jim Carr <c...@vr.net>
writes

Quote
>Can anyone tell me where I can find a good overview of setting up ODBC
>connections from within a Delphi application?  For example, I am connecting
>to an existing SQL Anywhere ODBC datasource from within my Delphi app, but
>I must go to the ODBC Control Panel applet to change the settings for the
>DSN.  It would be much more convenient (and friendlier to the end-user) if
>these settings could be changed from within the application.

We make connections via a TDatabase component - this allows us to
specify stuff like:

  with MyDatabase do begin
    Params.Add('USER NAME=foo');
    Params.Add('PASSWORD=bar');
    Params.Add('OPEN MODE=READ ONLY');
    LoginPrompt := False;
  end {with MyDatabase};

without going anywhere near the BDE config utilities.

John

+-------------------+--------------------------------------------------+
John P.McCreesh     | Net:   john.mccre...@forbolancs.co.uk
Forbo-Lancaster Ltd.| X.400: c=GB,a=CWMAIL,p=FORBO,s=McCreesh
Lancaster, England  | Voice: +44 (0)1524 65222 Fax: +44 (0)1524 61638

Re:Setting up ODBC parameters


Well how about using the BDE to store an alias that points to your ODBC
data source? All of the information can be preloaded into the BDE alias
and datasource, and off you go. Or am I missing something here?

Brad Miller
Timeoil...@aol.com

Other Threads