Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: odbc - load MS access queries + import access labels

From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: odbc - load MS access queries + import access labels
Date   Mon, 10 Jan 2005 22:57:12 +0900

Daniel Mueller wrote:

Two -odbc- questions (using an up-to-date Stata and Win XP):

1. Is it possible to load queries done in MS access into Stata? I am able to
read in all the tables using -odbc-, but can't see the MS access queries
after -odbc query-. I tried to insert the sql statement that generates the
queries with:

	. odbc load, exec("sql.txt") dialog(complete) clear

but receive error r(682). 
[listing deleted]

2. Did anybody find out how to transfer the variable description from MS
access as labels into Stata using -odbc-? (I found an older posting that
assumes this to be "a deficiency in Access drivers"
( Any news on


1.  "sql.txt" seems to be a file containing SQL statements and not an SQL 
statement.  -odbc load, exec()- is expecting a single SQL statement and not a 
file name.

For your purposes I believe that you can think of your Access "query" as 
equivalent to an SQL view.  In that case, you can first issue the SQL statement 
CREATE VIEW from Stata via -odbc exec- with your Access query as the argument, 
and then go through the view you just created and load the result table into 
Stata via -odbc load- in the usual manner.

2.  As I recall, column descriptions in Access are accessible only via Visual 
Basic or Visual Basic for Applications.

Joseph Coveney

*   For searches and help try:

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