Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: SQL Query Password/User ID


From   "Joseph Coveney" <jcoveney@bigplanet.com>
To   "Statalist" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Re: SQL Query Password/User ID
Date   Fri, 14 Dec 2007 10:28:52 +0900

Tam Phan wrote:

My password and Userid for odbc SQL connectivity is different from my
windows user's login.  I have registered this through Window's ODBC
data source administrator, however, SQL server is still asking me to
input userid and password whenever I query the database or any part of
the database. I can't seem to get the password burned in.  I believe
the way previous emails refer to is to use windows NT authentication
using the network login ID.  However, are there ways to handle such
automation if your windows login ID is different from SQL server id
and password?

--------------------------------------------------------------------------------

Perhaps you can use a "wrapper" program for -odbc- that stores your
authentication information temporarily in RAM for use each time during a
Stata session--something like the following:

program define myodbc
   version 10
   syntax anything [, *]
   capture assert "$us" == ""
   if !_rc display in smcl as text "What's your user ID" _request(us)
   capture assert "$pw" == ""
   if !_rc display in smcl as text "What's your password" _request(pw)
   odbc `"`anything'"', user($us) password($pw) `options'
end

I haven't tested this out, and so it might need a little tweaking.

But my first and strongest recommendation to take care of your problem is to
set up your Microsoft SQL Server installation for Windows NT login instead
of mixed mode, in accordance with the vendor's urging.

Joseph Coveney


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index