RECORDSET FEJL
Er der nogen der kan finde fejlen. Jeg kan røbe at fejlen ligger i linien:beatboxRecordset.open
Koden er som følger:
<%@ LANGUAGE=VBScript %>
<HTML>
<HEAD title="Your personal information was processed">
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
' ########## Begin Subroutine ##########
Sub ModifyUserInformation
Dim SQLString, DatabaseConnection, beatboxRecordSet
' Create an instance of the Connection Object
Set DatabaseConnection = Server.CreateObject("ADODB.Connection")
' Open a connection to the Guest Book File DSN
' Before the following statement can execute properly, you have to
' create a File DSN for the Guest Book database as outlined in the
' book.
DatabaseConnection.Open "FILEDSN=zyber.dsn"
' Create an Instance of the Recordset object
Set beatboxRecordset = Server.CreateObject("ADODB.Recordset")
' We retrieve the recordset containing the user's data.
' Notice how the recordset is opened so that we can use the
' update method of the Recordset object to modify the user's
' data
beatboxRecordSet.CursorType = 1
beatboxRecordSet.CursorLocation = 2
beatboxRecordSet.LockType = 3
beatboxRecordSet.ActiveConnection = DatabaseConnection
beatboxRecordSet.Source = "beatbox"
beatboxRecordSet.Filter = "ProduktID = " & Request.Form.Item("prodid")
' The Open method of the Recordset Object is used to retrieve
' data from the User Registration Database.
beatboxRecordset.Open
If beatboxRecordset.EOF Then
Response.Write ("<H1>Your record was not found.</H1>")
Else
beatboxRecordSet.Fields.Item ("ProduktID") = _
Request.Form.Item("prodid")
beatboxRecordSet.Fields.Item ("Produktnavn") = _
Request.Form.Item("prodnavn")
beatboxRecordSet.Fields.Item ("Produktbeskrivelse") = _
Request.Form.Item("prodbesk")
beatboxRecordSet.Fields.Item ("Antal") = _
Request.Form.Item("antal")
beatboxRecordSet.Fields.Item ("Billed") = _
Request.Form.Item("billed")
beatboxRecordSet.Fields.Item ("Indkobsvogn") = _
Request.Form.Item("indkob")
beatboxUserRecordSet.Update
Response.Write ("Følgende produkt er opdateret, " & Request.Form.Item("prodnavn") _
& "!<BR>")
Response.Write ("Fortsat god dag")
End If
' Database connections should always be closed once they are used.
beatboxUserRecordSet.Close
DatabaseConnection.Close
End Sub
' ########## End Subroutine ##########
If Request.Form.Count <= 0 Then
Response.Write ("I am sorry but you did not fill in the Form.")
Else
Call ModifyUserInformation
End If
%>
<P> </P>
<HR>
This Web page was generated on <%= Date %> at <%= Time %>.<BR>
<A HREF=Default.asp>Return to the User Registration System's main menu</A>.
</BODY>
</HTML>
