View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default ADO - recordset - closed excel workbook

"TK" wrote ...

Jet will not return both strings and numbers
in the same recordset so use rs for one, rs1 for
the another.


Where did you get this idea? This is clearly incorrect.


My statement should have read: With the code Im posting I was
unable to return both numbers and text from the same column
so I simply sent a second query to the workbook.


I don't understand. Your second query references a second column i.e.

strSQL = "Select * from [Sheet1$B9:B20]"
strSQL1 = "Select * from [Sheet1$A9:A10]"


so it cannot achieve your stated goal of returning 'both numbers and
text from the same column'.

If you have numbers and text in your column but you are getting null
values, Jet may be determining the data type using the 'majority type'
of the rows scanned instead of all values being coerced as 'Text'. For
details on the relevant registry settings and how you may change them
in your favor, see:

http://www.dicks-blog.com/excel/2004...al_data_m.html

Jamie.

--