Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Neil Shephard <nshephard@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: odbc connectivity |
Date | Mon, 24 Jan 2011 11:50:25 +0000 |
On Mon, Jan 24, 2011 at 10:01 AM, Abhimanyu Arora <abhimanyu.arora1987@gmail.com> wrote: > Dear statalist > I would like to view and load an ODBC source (connected by SQL server) > into stata. Earlier, I had followed the necessary steps (control > panel->administrative tools->data sources (odbc)->relevent dialog > boxes) to successfully create the odbc source to be viewed. > The problem is that while stata lists the source (called HerculesDB), > it doesn't load the tables > > . odbc list > > Data Source Name Driver > ------------------------------------------------------------------------------- > MS Access Database Microsoft Access Driver (*.mdb, *.accdb) > Excel Files Microsoft Excel Driver (*.xls, *.xlsx, *.xl > dBASE Files Microsoft Access dBASE Driver (*.dbf, *.ndx > HerculesDB SQL Server > ------------------------------------------------------------------------------- > > . odbc query "HerculesDB" > ODBC error; type -set debug on- and re-run command to see extended > error information > r(682); > > . set debug on > > . odbc query "HerculesDB" > Connection Parameters: DSN=HerculesDB; > [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user > 'ECON\n09040'., SQLSTATE=28000 > [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user > 'ECON\n09040'. > r(682); > > The description of the error says that a "common cause is insufficient > permissions to connect to the data source". Having tried all options > nevertheless, Your code above doesn't appear to include the option that seems most pertinent. The error message is saying "Login failed for user 'ECON\n09040'". On your line where you attempt to query the database using -odbc- you do not appear to be specifying any ,-user() password()- options which may be the cause of the login failing. > I would appreciate your alternative suggestions to solve > the problem.. I'd try using the -user()- and -password()- options to -odbc- when attempting to connect. Neil -- “Truth in science can be defined as the working hypothesis best suited to open the way to the next better one.” - Konrad Lorenz Email - nshephard@gmail.com Website - http://kimura.no-ip.org/ Photos - http://www.flickr.com/photos/slackline/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/