Salve,
Ho creato una popup dettagli per il listino della mia ditta
Sul server locale mi funziona correttamente ma in remoto mi da questo errore:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][Driver ODBC Excel] Tipi di dati non corrispondenti nell'espressione criterio.
/dettagli_listino.asp, line 15
Questo è il codice della pagina:
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim rsDettListino__MMColParam
rsDettListino__MMColParam = "1"
if (Request.QueryString("CODICE") <> "") then rsDettListino__MMColParam = Request.QueryString("CODICE")
%>
<%
set rsDettListino = Server.CreateObject("ADODB.Recordset")
rsDettListino.ActiveConnection = MM_conXLS_STRING
rsDettListino.Source = "SELECT * FROM Listino WHERE CODICE = '" + Replace(rsDettListino__MMColParam, "'", "''") + "'"
rsDettListino.CursorType = 0
rsDettListino.CursorLocation = 2
rsDettListino.LockType = 3
rsDettListino.Open()
rsDettListino_numRows = 0
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
' set the record count
rsDettListino_total = rsDettListino.RecordCount
' set the number of rows displayed on this page
If (rsDettListino_numRows < 0) Then
rsDettListino_numRows = rsDettListino_total
Elseif (rsDettListino_numRows = 0) Then
rsDettListino_numRows = 1
End If
' set the first and last displayed record
rsDettListino_first = 1
rsDettListino_last = rsDettListino_first + rsDettListino_numRows - 1
' if we have the correct record count, check the other stats
If (rsDettListino_total <> -1) Then
If (rsDettListino_first > rsDettListino_total) Then rsDettListino_first = rsDettListino_total
If (rsDettListino_last > rsDettListino_total) Then rsDettListino_last = rsDettListino_total
If (rsDettListino_numRows > rsDettListino_total) Then rsDettListino_numRows = rsDettListino_total
End If
%>
<%
' *** Move To Record and Go To Record: declare variables
Set MM_rs = rsDettListino
MM_rsCount = rsDettListino_total
MM_size = rsDettListino_numRows
MM_uniqueCol = "CODICE"
MM_paramName = "CODICE"
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Specific Record: handle detail parameter
If (MM_paramIsDefined And MM_rsCount <> 0) Then
' get the value of the parameter
param = Request.QueryString(MM_paramName)
' find the record with the unique column value equal to the parameter value
MM_offset = 0
Do While (Not MM_rs.EOF)
If (Cstr(MM_rs.Fields.Item(MM_uniqueCol).Value) = param) Then
Exit Do
End If
MM_offset = MM_offset + 1
MM_rs.MoveNext
Loop
' if not found, set the number of records and reset the cursor
If (MM_rs.EOF) Then
If (MM_rsCount < 0) Then MM_rsCount = MM_offset
If (MM_size < 0 Or MM_size > MM_offset) Then MM_size = MM_offset
MM_offset = 0
' reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Close
MM_rs.Open
End If
End If
End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range
If (MM_rsCount = -1) Then
' walk to the end of the display range for this page
i = MM_offset
While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size))
MM_rs.MoveNext
i = i + 1
Wend
' if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = i
If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount
End If
' if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) > 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery
End If
' move the cursor to the selected record
i = 0
While (Not MM_rs.EOF And i < MM_offset)
MM_rs.MoveNext
i = i + 1
Wend
End If
%>
<%
' *** Move To Record: update recordset stats
' set the first and last displayed record
rsDettListino_first = MM_offset + 1
rsDettListino_last = MM_offset + MM_size
If (MM_rsCount <> -1) Then
If (rsDettListino_first > MM_rsCount) Then rsDettListino_first = MM_rsCount
If (rsDettListino_last > MM_rsCount) Then rsDettListino_last = MM_rsCount
End If
' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<html>
<head>
<title>Dettaglio articoli</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
<link rel="stylesheet" href="listini.css" type="text/css">
<link rel="stylesheet" href="scroll_lisini.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="Layer1" style="position:absolute; left:11px; top:8px; width:300px; height:119px; z-index:1; background-color: #999999; layer-background-color: #999999; border: 1px none #000000">
<table width="300" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td height="1" background="sf-linee_dett_art.gif">[img]sf-linea_retta.gif[/img]</td>
</tr>
<tr>
<td height="15" bgcolor="#CCCCCC" background="sf-linee_dett_art.gif"></td>
</tr>
<tr>
<td height="15" bgcolor="#CCCCCC" background="sf-linee_dett_art.gif">
<div align="center">
<%
Response.write "[img] & rsDettListino.Fields.Item([/img]"
%>
</div>
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC" background="sf-linee_dett_art.gif"></td>
</tr>
<tr>
<td background="sf-linee_dett_art.gif" height="1">[img]sf-linea_retta.gif[/img]</td>
</tr>
<tr>
<td bgcolor="#666666" background="sf-linee_dett_art.gif">
<div align="center">
<% If Not rsDettListino.EOF Or Not rsDettListino.BOF Then %>
<%=(rsDettListino.Fields.Item("DESCRIZIONE").Value )%>
<% End If ' end Not rsDettListino.EOF Or NOT rsDettListino.BOF %>
</div>
</td>
</tr>
<tr>
<td background="sf-linee_dett_art.gif" height="1">[img]sf-linea_retta.gif[/img]</td>
</tr>
<tr>
<td background="sf-linee_dett_art.gif" height="15"></td>
</tr>
<tr>
<td background="sf-linee_dett_art.gif" height="15">
<div align="center"><a href="javascript:this.close();">:: chiudi finestra
::</a> </div>
</td>
</tr>
<tr>
<td background="sf-linea_retta.gif"></td>
</tr>
</table>
</div>
</body>
</html>
<%
rsDettListino.Close()
%>
Grazie
Andrea

Rispondi quotando
