Hi All
I have my all my excel fields display just fine, except fields which have commas in them. In those cases ASP just seems to ignore it.
Here's the ASP:
-------------------
<%
Dim cn,rs,strSQL,cnt
Set cn =server.createobject("ADODB.Connection")
Set rs =server.createobject("ADODB.Recordset")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\inetpub\ & _
"Extended Properties=Excel 8.0"
'Import by using Jet Provider.
strSQL = "SELECT * FROM [All resources$]"
response.write("<table border=""1"">")
response.write("<tr>")
response.write("<th width=""200"">Title</th>")
response.write("<th width=""100"">Author</th>")
response.write("<th width=""50"">Cost</th>")
response.write("<th width=""150"">Competency(s)</th>")
response.write("<th width=""200"">Description</th>")
response.write("</tr>")
rs.open strSql,cn,2,2
cnt=1
Do While NOT rs.EOF
response.write("<tr>")
response.write("<td>"&rs("Book Title")&"</td>")
response.write("<td>"&rs("Author")&"</td>")
response.write("<td>"&rs("Cost)&"</td>")
response.write("<td>"&rs("Competency")&"</td>")
response.write("<td>"&rs("Description")&"</td>")
response.write("</tr>")
cnt = cnt+1
rs.movenext
Loop
rs.close
response.write("</table>")
cn.Close
Set cn = Nothing
%>
-------------------
Here is an example excel file
********************************************
Book Title Author Cost Competency
-------------------------------------------
Title1 Author1 129 5
Title2 Author2 40 5
Title3 Author3 36 3,4
Title4 Author4 15 1,2,4
Title5 Author5 10.20 5
*********************************************
When I output the data on the asp page i get something similar to this:
Book Title Author Cost Competency
-------------------------------------------
Title1 Author1 129 5
Title2 Author2 40 5
Title3 Author3 36
Title4 Author4 15
Title5 Author5 10.20 5
It seems to ignore the Competency field when it has a comma in it.
Any ideas?
Thx in advance.
Shu
I have my all my excel fields display just fine, except fields which have commas in them. In those cases ASP just seems to ignore it.
Here's the ASP:
-------------------
<%
Dim cn,rs,strSQL,cnt
Set cn =server.createobject("ADODB.Connection")
Set rs =server.createobject("ADODB.Recordset")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\inetpub\ & _
"Extended Properties=Excel 8.0"
'Import by using Jet Provider.
strSQL = "SELECT * FROM [All resources$]"
response.write("<table border=""1"">")
response.write("<tr>")
response.write("<th width=""200"">Title</th>")
response.write("<th width=""100"">Author</th>")
response.write("<th width=""50"">Cost</th>")
response.write("<th width=""150"">Competency(s)</th>")
response.write("<th width=""200"">Description</th>")
response.write("</tr>")
rs.open strSql,cn,2,2
cnt=1
Do While NOT rs.EOF
response.write("<tr>")
response.write("<td>"&rs("Book Title")&"</td>")
response.write("<td>"&rs("Author")&"</td>")
response.write("<td>"&rs("Cost)&"</td>")
response.write("<td>"&rs("Competency")&"</td>")
response.write("<td>"&rs("Description")&"</td>")
response.write("</tr>")
cnt = cnt+1
rs.movenext
Loop
rs.close
response.write("</table>")
cn.Close
Set cn = Nothing
%>
-------------------
Here is an example excel file
********************************************
Book Title Author Cost Competency
-------------------------------------------
Title1 Author1 129 5
Title2 Author2 40 5
Title3 Author3 36 3,4
Title4 Author4 15 1,2,4
Title5 Author5 10.20 5
*********************************************
When I output the data on the asp page i get something similar to this:
Book Title Author Cost Competency
-------------------------------------------
Title1 Author1 129 5
Title2 Author2 40 5
Title3 Author3 36
Title4 Author4 15
Title5 Author5 10.20 5
It seems to ignore the Competency field when it has a comma in it.
Any ideas?
Thx in advance.
Shu