Newsgroup: it.comp.www.asp
Titolo: Errore ADO.Command

Dopo aver cambiato la stringa di connessione (ho usato il mappath), che
funziona se premo Connections-Test, quando vado ad inserire o aggiornare
qualche record mi da il seguente errore:
Tipo di errore:
ADODB.Command (0x800A0BB9)
Gli argomenti non sono di tipo valido, non sono compresi nell'intervallo
consentito o sono in conflitto.
il codice della pagina di inserimento è:
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="Connections/connstud2.asp" -->
<%
// *** Edit Operations: declare variables
// set the form action variable
var MM_editAction = Request.ServerVariables("URL");
if (Request.QueryString) {
  MM_editAction += "?" + Request.QueryString;
}
// boolean to abort record edit
var MM_abortEdit = false;
// query string to execute
var MM_editQuery = "";
%>
<%
// *** Insert Record: set variables
if (String(Request("MM_insert")) != "undefined") {
  var MM_editConnection = MM_connstud2_STRING;
  var MM_editTable  = "Studenti";
  var MM_editRedirectUrl = "ok.htm";
  var MM_fieldsStr =
"Nome|value|Cognome|value|Matricola|value|Data_di_nascita|value|IndirizzoPos
taElettronica|value|Corso|value|Data_appello|value|Annualit|value";
  var MM_columnsStr =
"Nome|',none,''|Cognome|',none,''|Matricola|none,none,NULL|[Data di
nascita]|',none,''|IndirizzoPostaElettronica|',none,''|Corso|',none,''|[Data
appello]|',none,''|Annualita|',none,''";
  // create the MM_fields and MM_columns arrays
  var MM_fields = MM_fieldsStr.split("|");
  var MM_columns = MM_columnsStr.split("|");
  // set the form values
  for (var i=0; i+1 < MM_fields.length; i+=2) {
    MM_fields[i+1] = String(Request.Form(MM_fields[i]));
  }
  // append the query string to the redirect URL
  if (MM_editRedirectUrl && Request.QueryString &&
Request.QueryString.length > 0) {
    MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1)?"?":"&")
+ Request.QueryString;
  }
}
%>
<%
// *** Insert Record: construct a sql insert statement and execute it
if (String(Request("MM_insert")) != "undefined") {
  // create the sql insert statement
  var MM_tableValues = "", MM_dbValues = "";
  for (var i=0; i+1 < MM_fields.length; i+=2) {
    var formVal = MM_fields[i+1];
    var MM_typesArray = MM_columns[i+1].split(",");
    var delim =    (MM_typesArray[0] != "none") ? MM_typesArray[0] : "";
    var altVal =   (MM_typesArray[1] != "none") ? MM_typesArray[1] : "";
    var emptyVal = (MM_typesArray[2] != "none") ? MM_typesArray[2] : "";
    if (formVal == "" || formVal == "undefined") {
      formVal = emptyVal;
    } else {
      if (altVal != "") {
        formVal = altVal;
      } else if (delim == "'") { // escape quotes
        formVal = "'" + formVal.replace(/'/g,"''") + "'";
      } else {
        formVal = delim + formVal + delim;
      }
    }
    MM_tableValues += ((i != 0) ? "," : "") + MM_columns[i];
    MM_dbValues += ((i != 0) ? "," : "") + formVal;
  }
  MM_editQuery = "insert into " + MM_editTable + " (" + MM_tableValues + ")
values (" + MM_dbValues + ")";
  if (!MM_abortEdit) {
    // execute the insert
    var 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) {
      Response.Redirect(MM_editRedirectUrl);
    }
  }
}
%>
<%
var rsDate = Server.CreateObject("ADODB.Recordset");
rsDate.ActiveConnection = MM_connstud2_STRING;
rsDate.Source = "SELECT GiornoAppello FROM Appelli";
rsDate.CursorType = 0;
rsDate.CursorLocation = 2;
rsDate.LockType = 3;
rsDate.Open();
var rsDate_numRows = 0;
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFCCFF" text="#000000">
<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">Matricola:</td>
      <td>
        <input type="text" name="Matricola" 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">IndirizzoPostaElettronica:</td>
      <td>
        <input type="text" name="IndirizzoPostaElettronica" value=""
size="32">
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Corso:</td>
      <td>
        <select name="Corso">
          <option value="Sociologia"  selected>Sociologia</option>
          <option value="Scienze della comunicazione" >Scienze della
comunicazione</option>
        </select>
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Data appello:</td>
      <td>
        <select name="Data_appello">
          <%
while (!rsDate.EOF) {
%>
          <option
value="<%=(rsDate.Fields.Item("GiornoAppello").Value)%>"><%=(rsDate.Fields.I
tem("GiornoAppello").Value)%></option>
          <%
  rsDate.MoveNext();
}
if (rsDate.CursorType > 0) {
  if (!rsDate.BOF) rsDate.MoveFirst();
} else {
  rsDate.Requery();
}
%>
        </select>
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Annualità:</td>
      <td>
        <select name="Annualit">
          <option value="Prima"  selected>Prima</option>
          <option value="Seconda" >Seconda</option>
        </select>
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">&nbsp;</td>
      <td>
        <input type="submit" value="Prenota">
      </td>
    </tr>
  </table>
  <input type="hidden" name="MM_insert" value="true">
</form>
<p>&nbsp;</p>
</body>
</html>
<%
rsDate.Close();
%>
Grazie per l'aiuto!

Aggiungi a qeuste righe:
    MM_editCmd.CommandText = MM_editQuery;
response.write MM_editQuery
response.end
    MM_editCmd.Execute();
MM_editCmd.ActiveConnection.Close();
E magari verifica o incolla qui la stringa. E' a questa riga che da errore
giusto?
--
:: Fate i bravi e non clonate le pecore!
:: Distractly yours... 
man...@ufologia.net