For Programmers: Free Programming Magazines  


Home > Archive > ASP > March 2005 > THE workaround for the Excel > 256 characters issue









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author THE workaround for the Excel > 256 characters issue
JV

2005-03-22, 8:55 am

Fellow members,

I have read tons of content on the issue that ASP can not read Excel
spreadsheet columns having more than 256 characters. I think I've read
them all ...

Here's what I do:
strExcelDocName = "c:\test.xls"
With cnnExcel
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=" & strExcelDocName & ";" & _
"Extended Properties=""Excel 8.0;IMEX=1;"""
.Open
End With

Set rstExcel = Server.CreateObject("ADODB.Recordset")

sTableName = "[sheet1$]"
sTableName = "select * from " & sTableName & ";"

rstExcel.Open sTableName, cnnExcel, _
adOpenStatic, adLockPessimistic

rstExcel.MoveFirst
Do While Not rstExcel.EOF
'
myString = rstExcel.Fields.Item(0).Value

rstExcel.MoveNext
loop

By now, the experts among us have already detected that 'my_string'
won't store values exceeding 256 characters.

If any one you has found / developed ANY workaround (or alternative) I
would be very much obliged ...

Thanks in advance.

JV

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com