Hey all,
I'm creating an Excel import utility using ASP/VBScript and I'm running into a wierd problem.
Once I'm in the proper record, I'm trying to parse the row and return the cell contents. Here's the (rough) code:
... pretty simple.
My problem is that my code always returns an empty string for any cell that has a date in the cell directly below AND there's any non-numerical chars in the cell in question. (ie. '123' returns fine, '12a' returns empty)
I've tried changing the cell to Text, General etc.. but nothing works. The truly odd thing is that all other cells return exactly as they should (non-numerical or not, column E or not).
Hope I didn't confuse anyone... any thoughts?
I'm creating an Excel import utility using ASP/VBScript and I'm running into a wierd problem.
Once I'm in the proper record, I'm trying to parse the row and return the cell contents. Here's the (rough) code:
Code:
'Conn string
Set oConn = Server.CreateObject("ADODB.Connection")
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("/ecr")&"\xlsTest.xls;Extended Properties=Excel 8.0"
oConn.Open strConn
'Select data
strSql = "SELECT * FROM [Sheet1$]"
Set oRS = oConn.Execute(strSql)
For each varItem in oRS.Fields
response.write varItem&"<BR>"
Next
My problem is that my code always returns an empty string for any cell that has a date in the cell directly below AND there's any non-numerical chars in the cell in question. (ie. '123' returns fine, '12a' returns empty)
I've tried changing the cell to Text, General etc.. but nothing works. The truly odd thing is that all other cells return exactly as they should (non-numerical or not, column E or not).
Hope I didn't confuse anyone... any thoughts?