Connection string assist added to odbc command
Stata’s odbc command permits you to import knowledge from and export knowledge to any ODBC knowledge supply in your pc. ODBC is a standardized means for functions to learn knowledge from and write knowledge to totally different knowledge sources equivalent to databases and spreadsheets.
Till now, earlier than you would use the odbc command, you had so as to add a named knowledge supply (DSN) to the pc through the ODBC Information Supply Administrator. For those who didn’t have administrator privileges in your pc, you would not do that.
Within the replace to Stata 11 launched 4 November 2010, a brand new possibility, connectionstring(), was added to the odbc command. This selection permits you to specify an ODBC knowledge supply on the fly utilizing an ODBC connection string as a substitute of getting to first add an information supply (DSN) to the pc. A connection string permits you to specify all essential parameters to determine a connection between Stata and the ODBC supply. Connection strings have an ordinary syntax for all drivers however there are additionally driver-specific key phrase/worth pairs that you would be able to specify. The three normal issues that you’ll most likely want in a connection string are DRIVER, SERVER, and DATABASE. For instance,
odbc load, … ///
connectionstring(“DRIVER={SQL Server};SERVER=myserver;DATABASE=db;”)
For those who additionally have to specify a username and password to get entry to your database you’d kind
odbc load, …///
conn(“DRIVER={SQL Server};SERVER=server;DATABASE=db;UID=id;PWD=pwd;”)
Once more, there are driver particular key phrase/worth pairs you’ll be able to add to the connection string. You may carry out a search on the Web for “connection string” and your database identify to seek out what different choices you’ll be able to specify within the connection string. Simply bear in mind to separate every connection string key phrase/worth pair with a semicolon. You may learn extra about connection string syntax on Microsoft’s web site.
To get this functionality in your copy of Stata 11, merely kind replace all and observe the directions to finish the replace. You may then kind assist odbc to learn extra concerning the connectionstring() possibility.
