Board index » delphi » Can i create a new System DSN (Alias)

Can i create a new System DSN (Alias)

Hi you all  Delphi fan...

Is there anyway to make a new alias (System dsn) witout using the Management
from the Controlpannel???    Something like writing in the Reg.db or ???
Anyone ??

--

Bedst Regards
M. Larsen

 

Re:Can i create a new System DSN (Alias)


Hi Martin

You could use:

TStringList *AliasParm = new TStringList();
Session->ConfigMode = cmSession;

AliasParm->Clear();
AliasParm->Add("PATH=YOURDESIREDPATH");
Session->AddAlias("AliasName", "PARADOX", AliasParm);

delete AliasParm;

This sample code creates a temporary alias called AliasName using Paradox
driver.

Please note that this code is C++ Builder, and you should take a look at
Session ConfigMode and AddAlias for more information.

HTH
Antonio

Re:Can i create a new System DSN (Alias)


On Tue, 1 Aug 2000 00:48:07 +0200, "Martin P. Larsen" <n...@mpsoft.dk>
wrote:

Quote
>Is there anyway to make a new alias (System dsn) witout using the Management
>from the Controlpannel???    Something like writing in the Reg.db or ???
>Anyone ??

Yes,  you can call into the ODBC API directly to do this.  I do not know
how to do it from Delphi,  but there is an example of how to do that from
C++ in Code Central (look for MDBTOOLS)...

Jerry Bloomfield (TeamB)
--
http://www.teamb.com                                      JersW...@wwa.com
Please do *NOT* send private e-mail without prior permission (my anti-spam
filters will probably just delete it anyway <g>)

Other Threads