BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

User setup of SQL connection string

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Bill Cart
Guest





PostPosted: Tue Mar 08, 2005 3:24 pm    Post subject: User setup of SQL connection string Reply with quote



We have a program we plan on distributing to other agencies. We have done
this before with MS Access but now we want to use SQL server. While
developing the application we have been using Data Link files. What is the
best way of letting a user (or most likely in this case their IT group) set
up the database connection string: a Data Link file, a text file or some
other way? Any thoughts or experiences to pass along?


Back to top
Eric Hill
Guest





PostPosted: Tue Mar 08, 2005 3:53 pm    Post subject: Re: User setup of SQL connection string Reply with quote



Use UDL files. They are *very* handy and the OS does the work for you.

Your ADOConnection just uses 'File Name=someudlfile.udl' for the connection string. You can
ShellExecute the udl file and Windows will pop up the configuration box complete with a test button.
They work for ODBC and OLEDB data sources. They are text files so you can "clone" them with a
TStringList. That are also INI files so the TIniFile works like a charm with them. A
TFileOpenDialog (is that the right name?) with a "Data Link Files|*.udl" mask will let the user
choose an available connection. Creating a new connection is as simple as creating an empty file
and ShellExecuting it. You can do OS permissions on the files so company-defined UDL files can only
be changed by an administrator.

The list goes on, but suffice it to say that I really like using UDL files.

Eric


Back to top
Bas van Beek
Guest





PostPosted: Tue Mar 08, 2005 4:50 pm    Post subject: Re: User setup of SQL connection string Reply with quote



I usually have registry settings to get/set the connectionstring and
have the standard connection setup box pop up at the user interface if
they need to change settings or if a connection fails.

try this:

newConnString := PromptDataSource(Self.Handle, oldConnString);

Regards,

Bas van Beek


Bill Cart wrote:
Quote:
We have a program we plan on distributing to other agencies. We have done
this before with MS Access but now we want to use SQL server. While
developing the application we have been using Data Link files. What is the
best way of letting a user (or most likely in this case their IT group) set
up the database connection string: a Data Link file, a text file or some
other way? Any thoughts or experiences to pass along?



Back to top
Bill Todd
Guest





PostPosted: Tue Mar 08, 2005 5:11 pm    Post subject: Re: User setup of SQL connection string Reply with quote

Be very careful about including the password in the UDL file.

--
Bill Todd (TeamB)
TeamB cannot answer questions received via email
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.