Sto costruendo per la mia società di ciclismo un modulo di registrazione on line alla gara che stiamo organizzando, ma quando lo voglio provare mi appare questo errore:
Tipo di errore:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][Driver ODBC Microsoft Access] Impossibile usare "(sconosciuto)". File già in uso.
/Bici Camogli/TMP339m9wxmqn.asp, line 113
Uso Access 97, e ho messo una copia che si chiama "Bici Camogli" nella cartella del sito insieme ai file asp e un'altra copia nella cartella del server di prova.
Sono andato alla linea 113 del file "Modulo Iscrizione" e appare questo: MM_editCmd.ActiveConnection = MM_editConnection
Purtroppo io di codice non so niente, perché tutto quello che è scritto lo fa Dreamweaver MX 2004.
Inoltre quando provo i due pulsanti di scelta Amatore e Cicloturista (quando è selezionato uno l'altro deve rimanere vuoto) e clicco per vedere se funzionano rimangono "accesi" tutti e due.
Ho provato a modificare le impostazioni, prima con Y/N poi con 1,0, ma il risultato è sempre lo stesso.
Vi giro il codice per farvi capire meglio. Spero di essere stato chiaro.
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/BiciCamogli.asp" -->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
If (CStr(Request("MM_insert")) = "form1") Then
MM_editConnection = MM_BiciCamogli_STRING
MM_editTable = "[Iscritti Gara]"
MM_editRedirectUrl = "IscrizioniOK.asp"
MM_fieldsStr = "Nome|value|Cognome|value|Indirizzo|value|CAP|value|Citt|value|Provincia|value|Numero_Tessera|value|Data_di_Nascita|value|Telefono|value|email|value|CodiceSociet|value|Societ|value|NomeSociet|value|IndirizzoSociet|value|CAPSociet|value|CittSociet|value|ProvinciaSociet|value|Ente|value|Amatore|value|Cicloturista|value"
MM_columnsStr = "Nome|',none,''|Cognome|',none,''|Indirizzo|',none,''|CAP|none,none,NULL|Città|',none,''|Provincia|',none,''|[Numero Tessera]|none,none,NULL|[Data di Nascita]|',none,''|Telefono|',none,''|e-mail|',none,''|CodiceSocietà|',none,''|Società|',none,''|NomeSocietà|',none,''|IndirizzoSocietà|',none,''|CAPSocietà|none,none,NULL|CittàSocietà|',none,''|ProvinciaSocietà|',none,''|Ente|',none,''|Amatore|none,1,0|Cicloturista|none,1,0"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
If (CStr(Request("MM_insert")) <> "") Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<body onLoad="MM_preloadImages('Images%20Bici%20Camogli/Bar%20Area%20Riservata%20on.png','Images%20Bici%20Camogli/Bar%20Home%20on.jpg','Images%20Bici%20Camogli/Bar%20Societa%20on.jpg','Images%20Bici%20Camogli/Bar%20Eventi%20on.jpg','Images%20Bici%20Camogli/Bar%20Attivita%20on.jpg','Images%20Bici%20Camogli/Bar%20Contatti%20on.jpg','Images%20Bici%20Camogli/Bar%20Area%20Riservata%20on.jpg')">
<table width="95%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a href="default.asp" target="_top" onClick="MM_nbGroup('down','group1','home','',1)" onMouseOver="MM_nbGroup('over','home','Images%20Bici%20Camogli/Bar%20Home%20on.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images%20Bici%20Camogli/Bar%20Home%20down.jpg" alt="" name="home" border="0" onload=""></a></td>
<td><a href="societa.asp" target="_top" onClick="MM_nbGroup('down','group1','societa','',1)" onMouseOver="MM_nbGroup('over','societa','Images%20Bici%20Camogli/Bar%20Societa%20on.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images%20Bici%20Camogli/Bar%20Societa%20down.jpg" alt="" name="societa" border="0" onload=""></a></td>
<td><a href="eventi.asp" target="_top" onClick="MM_nbGroup('down','group1','eventi','',1)" onMouseOver="MM_nbGroup('over','eventi','Images%20Bici%20Camogli/Bar%20Eventi%20on.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images%20Bici%20Camogli/Bar%20Eventi%20down.jpg" alt="" name="eventi" border="0" onload=""></a></td>
<td><a href="attivita.asp" target="_top" onClick="MM_nbGroup('down','group1','attivita','',1)" onMouseOver="MM_nbGroup('over','attivita','Images%20Bici%20Camogli/Bar%20Attivita%20on.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images%20Bici%20Camogli/Bar%20Attivita%20down.jpg" alt="" name="attivita" border="0" onload=""></a></td>
<td><a href="contatti.asp" target="_top" onClick="MM_nbGroup('down','group1','contatti','',1)" onMouseOver="MM_nbGroup('over','contatti','Images%20Bici%20Camogli/Bar%20Contatti%20on.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images%20Bici%20Camogli/Bar%20Contatti%20down.jpg" alt="" name="contatti" border="0" onload=""></a></td>
<td><a href="area_riservata.asp" target="_top" onClick="MM_nbGroup('down','group1','area_riservata','',1)" onMouseOver="MM_nbGroup('over','area_riservata','Images%20Bici%20Camogli/Bar%20Area%20Riservata%20on.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img src="Images%20Bici%20Camogli/Bar%20Area%20Riservata%20down.jpg" alt="" name="area_riservata" border="0" onload=""></a></td>
</tr>
</table>
<h3 align="center"><font face="Arial, Helvetica, sans-serif">Modulo di Iscrizione</font></h3>
<p> </p>
<form method="POST" action="<%=MM_editAction%>" name="form1">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Nome:</td>
<td> <input type="text" name="Nome" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Cognome:</td>
<td> <input type="text" name="Cognome" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Indirizzo:</td>
<td> <input type="text" name="Indirizzo" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">CAP:</td>
<td> <input type="text" name="CAP" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Città:</td>
<td> <input type="text" name="Citt" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Provincia:</td>
<td> <input type="text" name="Provincia" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Numero Tessera:</td>
<td> <input type="text" name="Numero_Tessera" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Data di Nascita:</td>
<td> <input type="text" name="Data_di_Nascita" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Telefono:</td>
<td> <input type="text" name="Telefono" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">E-mail:</td>
<td> <input type="text" name="email" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">CodiceSocietà:</td>
<td> <input type="text" name="CodiceSociet" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Società:</td>
<td> <input type="text" name="Societ" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">NomeSocietà:</td>
<td> <input type="text" name="NomeSociet" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">IndirizzoSocietà:</td>
<td> <input type="text" name="IndirizzoSociet" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">CAPSocietà:</td>
<td> <input type="text" name="CAPSociet" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">CittàSocietà:</td>
<td> <input type="text" name="CittSociet" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">ProvinciaSocietà:</td>
<td> <input type="text" name="ProvinciaSociet" value="" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Ente:</td>
<td> <input type="text" name="Ente" value="" size="32"> </td>
</tr>
<tr>
<td nowrap align="right" valign="top">Amatore:</td>
<td valign="baseline"> <table align="left">
<tr>
<td> <input name="Amatore" type="radio" value="" checked > Amatore
<td></tr>
</table></td>
</tr>
<tr>
<td nowrap align="right" valign="top">Cicloturista:</td>
<td valign="baseline"> <table align="left">
<tr>
<td> <input type="radio" value="" name="Cicloturista" >
Cicloturista
<td></tr>
</table></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td> <input type="submit" value="Invia"> </td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</body>
</html>