Rose wrote:
Thank you very much for your reply!
Now that sometimes errors indeed exist,
I will consider other methods instead of openning EXCEl directly in the stata.
--------------------------------------------------------------------------------
Before trying tedious or complicated other methods, consider a couple of
experiments to see if they fix the problem.
First:
By default, ODBC scans only the first eight rows in order to guess the datatype
(numeric or text). Your variable c was empty for the first eight rows, and ODBC
might have assumed that the blank cells would be text.
Try specifying the rows to scan in the DSN string as follows to see whether it
works for your dataset:
odbc load, table(1998$) dsn("Excel Files;DBQ=xxx.xls;MaxScanRows=16;")
Second:
If that doesn't work, then try the workaround--it's not very complicated,
actually only two lines of code:
odbc load, dsn("Excel Files;DBQ=xxx.xls;") ///
exec("SELECT * FROM [Excel 8.0;HDR=YES;IMEX=1;Database=xxx.xls;].[1998$];")
destring x-c, replace
Joseph Coveney
*
* 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/