Page 1 of 1 1
Topic Options
#119405 - 2004-05-12 12:08 AM odbc connection with username + password
leno Offline
Fresh Scripter

Registered: 2002-09-18
Posts: 30
i am looking for a way to configure odbc connection to sql server with username and password ( NOT A TRUSTED CONNECTION ) but i can't find how to do it ?
Top
#119406 - 2004-05-12 01:09 AM Re: odbc connection with username + password
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Did you get a chance to look (i.e. Search) here on this site?

ODBCSQL() - Create an SQL ODBC Connection

And, looking at - http://www.databasejournal.com/features/mssql/article.php/2238221

We should be able to add right below:
Code:

$DriverName='SQL Server'
$Trusted_Connection='Yes'



And..
Code:

$RC=WRITEVALUE($RegEdPath,'Server',$Server,'REG_SZ')
$RC=WRITEVALUE($RegEdPath,'Trusted_Connection',$Trusted_Connection,'REG_SZ')



HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#119407 - 2004-05-12 01:52 PM Re: odbc connection with username + password
leno Offline
Fresh Scripter

Registered: 2002-09-18
Posts: 30
this is only for the trusted connection i want to connect with user=sa and password=123456 for example ?

Top
#119408 - 2004-05-12 02:15 PM Re: odbc connection with username + password
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
It has been my experience that the UserID (or @userid) has been used it is kept as the last userid, but once the Password has been used - the password is never kept in the registry.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#119409 - 2004-05-12 02:50 PM Re: odbc connection with username + password
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

...user=sa and password=123456




tsk, tsk... giving away the SA password in a script.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#119410 - 2004-05-12 02:58 PM Re: odbc connection with username + password
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Les raises a very good point here.. You should never, ever have a "clear text" password in a script.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#119411 - 2004-05-13 08:18 AM Re: odbc connection with username + password
leno Offline
Fresh Scripter

Registered: 2002-09-18
Posts: 30
i know that password should not be send in clear text by script but i need to do it this way. does anyone know where can i add the password ?
Top
#119412 - 2004-05-15 11:34 PM Re: odbc connection with username + password
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
http://www.connectionstrings.com/
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 138 anonymous users online.
Newest Members
MaikSimon, kvn317, kixtarts2025, SERoyalty, mytar
17872 Registered Users

Generated in 0.061 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org