Visualizzazione dei risultati da 1 a 3 su 3

Discussione: problema aggiunta news

  1. #1

    problema aggiunta news

    Microsoft VBScript runtime error '800a01b6'

    Object doesn't support this property or method: 'RecSet.addnews'

    /News_DB.asp, line 59

    Questo è l'errore che mi riporta l'ho evidenziato di rosso. Qualcuno sa spiegarmi come mai non funziona? Grazie.

    <%
    'PERCORSO DEL DATABASE
    url_DB = "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/fpdb/database.mdb")

    Set Conn = Server.CreateObject("ADODB.Connection")
    conn.open url_DB

    'CONTROLLA CHE TUTTI I CAMPI SIANO STATI COMPILATI
    If Len(Request("autore")) = 0 or Len(Request("titolo")) = 0 or Len(Request("contenuto")) = 0 then

    'CAMPI NON COMPILATI
    %>
    <hr>
    <p align="center"><font face="Verdana" size="4">Campi non compilati!</font>
    </p>
    <%

    else

    'CAMPI COMPILATI

    'RICEVE L'OPERAZIONE DA SVOLGERE (AGGIUNGERE O MODIFICARE LE NEWS)
    operazione = Request.QueryString("tipo")

    Set RecSet = Server.CreateObject("ADODB.Recordset")

    'IN BASE ALL'OPERAZIONE CREA LA QUERY AL DATABASE

    If operazione = "aggiungi" then
    'DEVE AGGIUNGERE LA NEWS
    SQL = "SELECT * FROM NEWS"

    else

    'DEVE MODIFICARE LA NEWS
    SQL = "SELECT * FROM NEWS WHERE ID = " & Request.QueryString("id") &""

    RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic
    End IF
    'OPERAZIONE: AGGIUNGI NEWS

    If operazione = "aggiungi" then RecSet.Addnews

    AGGIUNGE LA DATA CORRRENTE
    RecSet("data") = date()
    End If

    RecSet("titolo") = Request.Form("titolo")
    RecSet("autore") = Request.Form("autore")
    RecSet("contenuto") = Replace(Request.Form("contenuto"), chr(13), "
    ")

    'AGGIORNA E CHIUDE IL DB
    RecSet.Update
    RecSet.Close
    Set RecSet = Nothing
    %>
    <hr>
    <p align="center"><font face="Verdana" size="4">Operazione eseguita correttamente!</font>
    <hr>
    <%

    Conn.Close
    Set Conn = Nothing
    %>

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
    RecSet.Addnew
    Roby

  3. #3
    Grazie! L'errore era proprio di digitalizzazione..ora però nella stessa linea mi dice questo:

    ADODB.Recordset error '800a0e78'

    Operation is not allowed when the object is closed.

    /News_DB.asp, line 59

    da cosa può dipendere?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.