J’ai un problème ave la mise a jour de la base de donnée "authors" avec ASP
J’ai utilisé se code la pour ajouter/supp dans la base de donnée :
<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
<% Response.Expires= -1 %>
<HTML >
<HEAD>
<TITLE>Exemple d'ajout/suppression dans une base de données</TITLE>
</HEAD>
<BODY BGCOLOR="#ffcc00">
<hr size="1" color="#000000">
<% Dim oConn
Dim oRs
Dim filePath
' Map authors database to physical path
filePath = Server.MapPath("authors.mdb")
' Create ADO Connection Component to connect with sample database
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
' To add, delete and update recordset, it is recommended to use
' direct SQL statement instead of ADO methods.
oConn.Execute "insert into authors (author, YearBorn) values ('Paul Enfield', 1967)"
' Output Result
Set oRs = oConn.Execute (" select * from authors where Author= 'Paul Enfield' and YearBorn =1967 " )
Response.Write("<p>Inserted Author: " & oRs("Author") & "," & oRs("YearBorn"))
' Close Recordset
oRs.Close
Set oRs= Nothing
' Delete the inserted record
oConn.Execute "Delete From authors where author='Paul Enfield' and YearBorn = 1967 “
' Output Status Result
Response.Write("<p>Deleted Author: Paul Enfield, 1967")
%>
</BODY>
</HTML>
alors j'ai cette erreur:
________________________________________________________________
Erreur de compilation Microsoft VBScript error '800a0401'
Fin d'instruction attendue
/iisHelp/common/500-100.asp, line 11
Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP Dim strMethod, lngPos, datNow, strQueryString, strURL
--------------------------------------------------------------------------^
Microsoft JET Database Engine error '80004005'
L'opération doit utiliser une requête qui peut être mise à jour.
/aspj/AddDelete_VBScript.asp, line 79
____________________________________________________________
J’ai cassé ma tête avec sa mais pas de résultat
Alors si VOUS avez une SOLUTION je VOUS remercie
Partager