View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_3_] Dick Kusleika[_3_] is offline
external usenet poster
 
Posts: 599
Default adodb.recordset with excel

Nate

Here's everything you ever wanted to know about mixed data types

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

Thanks to OneDayWhen for this awesome contribution.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"nate axtell" <naxtell at progeny dot net wrote in message
...
I'm using an adodb.recordset to query and obtain the contents of an Excel
file in ASP with VBScript.
I'm having a problem when there are numeric entries mixed with alpha &
numeric entries within the same column.
The query I use seems to pick one of the two types and return NULL for any
of the other type.
Is there a way to specify that the columns will all be of a specific type?
I've tried to set the format in the Excel file to all General or all Text
but that doesn't seem to help. Any ideas would help, thanks.
Here's some code of what i'm doing basically:
...
Set XLconn = CreateObject("ADODB.Connection") 'Excel connection object
XLconn.ConnectionString = connectstr
XLconn.Open
Set XLrs = CreateObject("ADODB.Recordset") 'create the record set object
XLrs.cursortype = 3
XLrs.open "Select * From [sheet1$]", XLconn
...
Thanks,
Nate