leggere file xls

fighter57

Nuovo Utente
10 Set 2013
5
0
0
Leggo il contenuto di un file xls con lo script ASP sotto riportato.
Nel file xls ho una colonna dove sono riportate le MATRICOLA delle armi registrate.
Il problema è che se sono registrati valori numerici e valori alfanumerici la visualizzazione non è corretta, nel senso che, o mi mostra solo i valori numerici o solo quelli alfanumerici.
Questo credo di aver capito è un problema noto, ma non sono riuscito a trovare nessuna soluzione.
Qualcuno consigliava di far leggere tutto come formato testo ma non ho capito bene la procedura da seguire.
POTETE AIUTARMI????

Parte dello script asp.
.......
<TABLE BORDER=1 cellspacing="0" cellpadding="5" style="border-collapse: collapse; margin-left:10; border-left-width:0px; border-right-width:0px; border-top-width:0px" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<TR><TH colspan="4" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium">
<p align="left"><span style="font-weight: 400"><font face="Verdana" size="2" color="#666666">Il test del
file - <b> <%=Session("excel")%> </b> - ha dato esito positivo</font></span></TH>
<TH colspan="2" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top: medium none #FFFFFF">
<font face="Verdana" style="font-size: 8pt">
<input type="button" value="Continua" name="B2" style="float: center; font-family: Verdana; font-size: 10px" onclick="FP_goToURL(/*href*/'../prova_excel_continua.asp')"></TH></TR>
<TR><TH bgcolor="#006699" style="border-left-color: #FFFFFF; border-left-width: 1px">
<p style="margin-left: 10px; margin-right: 10px">
<font face="Verdana" style="font-size: 8pt" color="#FFFFFF">TIPO</font></TH>
<TH bgcolor="#006699">
<p style="margin-left: 10px; margin-right: 10px">
<font face="Verdana" style="font-size: 8pt" color="#FFFFFF">MARCA</font></TH>
<TH bgcolor="#006699">
<p style="margin-left: 10px; margin-right: 10px">
<font face="Verdana" style="font-size: 8pt" color="#FFFFFF">CALIBRO</font></TH>
<TH bgcolor="#006699">
<p style="margin-left: 10px; margin-right: 10px">
<font face="Verdana" style="font-size: 8pt" color="#FFFFFF">MATRICOLA</font></TH>
<TH bgcolor="#006699">
<p style="margin-left: 10px; margin-right: 10px">
<font face="Verdana" style="font-size: 8pt" color="#FFFFFF">CANNA</font></TH>
<TH bgcolor="#006699" style="border-right-color: #FFFFFF; border-right-width: 1px">
<p style="margin-left: 10px; margin-right: 10px">
<font face="Verdana" style="font-size: 8pt" color="#FFFFFF">PESO</font></TH></TR>
<%
fileXLS = Server.MapPath("prova_excel\"&Session("excel")&"")
Set Conn = Server.CreateObject("ADODB.Connection")


str = "DRIVER={Microsoft Excel Driver (*.xls)}; Estesa Properties = Excel 8.0, HDR = Yes; IMEX = 1; DBQ=" & fileXLS
Conn.Open str


Set rs = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM [Foglio1$]"
rs.Open strSQL, Conn
rs.movefirst
While Not rs.EOF
response.write "<TR><TD>"&"<font face=""Verdana"" style=""font-size: 8pt"">"& rs("TIPO").VALUE & "</TD>"
response.write "<TD>"&"<font face=""Verdana"" style=""font-size: 8pt"">" & rs("MARCA").VALUE & "</TD>"
response.write "<TD>"&"<font face=""Verdana"" style=""font-size: 8pt"">"&"<p align=""center"">" & rs("CALIBRO").VALUE & "</TD>"
response.write "<TD>"&"<font face=""Verdana"" style=""font-size: 8pt"">"&"<p align=""center"">" & rs("MATRICOLA").VALUE & "</TD>"
response.write "<TD>"&"<font face=""Verdana"" style=""font-size: 8pt"">"&"<p align=""center"">" & rs("CANNA") & "</TD>"
response.write "<TD>"&"<font face=""Verdana"" style=""font-size: 8pt"">"&"<p align=""center"">" & rs("PESO").VALUE & "</TD></TR>"
rs.movenext
wend
rs.close
set rs = Nothing
conn.close
set conn = Nothing
%>
</TABLE>
.......
 

Discussioni simili