p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: excel as datasource


Message #1 by "Breucq Kristof" <kristof.breucq@p...> on Tue 20 Feb 2001 01:30:12 MET
Don't know much about Excel in particular, but are the line breaks being
stored as vbCrLf in Excel. You'll probably need to replace them with
something else, like "<br>"

That's the only thing I can think of OTOH.

Cheers
Ken

----- Original Message -----
From: "Breucq Kristof" <kristof.breucq@p...>
To: "Code Clinic" <proasp_codeclinic@p...>
Sent: Wednesday, February 21, 2001 7:57 AM
Subject: excel as datasource


> Hello,
>
> when i use excel as a data source, there seems to be a problem when a cell
consists of two lines. The first line is read as a field.value, the second
too but is always empty. Anyone knows how to deal with this strange problem?
>
> Thanks.
>
> Kristof.
>
> the code , if this might help you:
>
>
> Set oRs = oConn.Execute("[" & vXlRange & "]")
> DataTable = DataTable & "<tr>"
>
> For Each oField in oRs.Fields
> DataTable = DataTable & vThTag & replace(oField.Name, "#", ".") &
vThEndTag
> Next
>
> DataTable = DataTable & "</tr>"
>
> Do While Not oRs.Eof
> DataTable = DataTable & "<tr>"
>
> For Each oField in oRs.Fields
> theValue = oField.Value
> if vXLRound then theValue = Round(oField.value, 2)
> DataTable = DataTable & "<td nowrap>" & theValue & "</td>"
> Next
>
> DataTable = DataTable & "</tr>"
> oRs.MoveNext
> Loop



  Return to Index