Er der nogen, der kan hjælpe mig. Jeg får denne fejlmelding :
Fejltype:
ADODB.Recordset (0x800A0C93)
Denne handling er ikke tilladt i denne sammenhæng.
/www/kta booking(2)/admin/add.asp, line 253
Her er add.asp filen:
<!--#include file="loggedin.asp"-->
<!--#include file="dsn.asp"-->
<!--#include file="body.asp"-->
<!-- #include file="Listbox.asp" -->
<html>
<head>
<title>Palle H</title>
<script language="javascript">
function open_Event_Name() {
popupWin = window.open('help.asp?ID=Event_Name', 'remote',
'width=300,height=200')
}
function open_Event_Date() {
popupWin = window.open('help.asp?ID=Event_Date', 'remote',
'width=300,height=200')
}
function open_Event_Time() {
popupWin = window.open('help.asp?ID=Event_Time', 'remote',
'width=300,height=200')
}
function open_Event_Category() {
popupWin = window.open('help.asp?ID=Event_Category', 'remote',
'width=300,height=200')
}
function open_Event_Location() {
popupWin = window.open('help.asp?ID=Event_Location', 'remote',
'width=300,height=200')
}
function open_Event_Buskorsel() {
popupWin = window.open('help.asp?ID=Event_Buskorsel', 'remote',
'width=300,height=200')
}
function open_Event_Booket() {
popupWin = window.open('help.asp?ID=Event_Booket', 'remote',
'width=300,height=200')
}
function open_Event_Instruktor2() {
popupWin = window.open('help.asp?ID=Event_Instruktor2',
'remote', 'width=300,height=200')
}
function open_Event_Description() {
popupWin = window.open('help.asp?ID=Event_Description',
'remote', 'width=300,height=200')
}
function VerifyData() {
if (document.frmUser.Event_Name.value == "") {
alert("Du skal udfylde alle felterne / du kan dog undlade
bemærkninger.");
return false;
} else if (document.frmUser.Category.value == "") {
alert("Du skal udfylde alle felterne / du kan dog undlade
bemærkninger.");
return false;
} else if ((document.frmUser.Date_Month.value == "Blank") ||
(document.frmUser.Date_Day.value == "Blank") ||
(document.frmUser.Date_Year.value == "Blank") ||
(document.frmUser.Time_Hour.value == "Blank") ||
(document.frmUser.Time_Minute.value == "Blank") ||
(document.frmUser.Time_AMPM.value == "Blank")) {
alert("Du skal indtaste både måned/dag/år.");
return false;
} else
return true;
}
</script>
<!--#include file="style.asp"-->
</head>
<body bgcolor="#F0F0F0" vlink="#48576C" link="#48576C"
alink="#000000"
rightmargin="150">
<p>
<br>
</p>
<table border="0" cellpadding="0" cellspacing="0" width="650"
align="center">
<tr>
<td height="1" colspan="5" bgcolor="#000000"><img
src="../im/clear.gif" height="1" width="1"></td>
</tr>
<tr>
<td width="1" bgcolor="#000000"><img src="../im/clear.gif"
height="1" width="1"></td>
<td colspan="3" bgcolor="#52637B" height="35" width="648"><font
face="Verdana" size="5"
color="#FFCC00"><b> ........</b></font></td>
<td width="1" bgcolor="#000000"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td height="1" colspan="5" bgcolor="#000000"><img
src="../im/clear.gif" height="1" width="1"></td>
</tr>
<tr>
<td width="1" bgcolor="#000000"><img src="../im/clear.gif"
height="1" width="1"></td>
<td bgcolor="#8199DA" valign="top" width="130">
<table border="0" cellpadding="0" cellspacing="0" width="130">
<tr>
<td bgcolor="#B0C4DE" width="130" height="15"><a
href="main.asp"><font face="Verdana"
size="1"><b> Home</b></font></a></td>
</tr>
<tr>
<td bgcolor="#000000" height="1"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td height="5"><img src="../im/clear.gif" height="5"
width="1"></td>
</tr>
<tr>
<td bgcolor="#000000" height="1"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td bgcolor="#B0C4DE" width="130" height="15"><a
href="add.asp"><font face="Verdana"
size="1"><b> </b></font><b><font
face="Verdana" size="1">Book</font></b></a></td>
</tr>
<tr>
<td bgcolor="#000000" height="1"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td bgcolor="#B0C4DE" width="130" height="15"><a
href="view.asp"><font face="Verdana"
size="1"><b> </b></font><b><font
face="Verdana" size="1">Se/Søg/Rediger</font></b></a></td>
</tr>
<tr>
<td bgcolor="#000000" height="1"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td bgcolor="#B0C4DE" width="130" height="15"><a
href="categories_add.asp"><font face="Verdana"
size="1"><b> </b></font><b><font
face="Verdana" size="1">Tilføj kategori</font></b></a></td>
</tr>
<tr>
<td bgcolor="#000000" height="1"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td bgcolor="#B0C4DE" width="130" height="15"><a
href="categories.asp"><font face="Verdana"
size="1"><b> </b></font><b><font
face="Verdana" size="1">Se kategorier</font></b></a></td>
</tr>
<tr>
<td bgcolor="#000000" height="1"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td height="5"><img src="../im/clear.gif" height="5"
width="1"></td>
</tr>
<tr>
<td bgcolor="#000000" height="1"><img src="../clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td bgcolor="#B0C4DE" width="130" height="15"><a
href="settings.asp"><font face="Verdana"
size="1"><b> </b></font><b><font
face="Verdana" size="1">Indstillinger</font></b></a></td>
</tr>
<tr>
<td bgcolor="#000000" height="1"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td height="5"><img src="../im/clear.gif" height="5"
width="1"></td>
</tr>
<tr>
<td bgcolor="#000000" height="1"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td bgcolor="#B0C4DE" width="130" height="15"><a
href="logout.asp"><font face="Verdana"
size="1"><b> Log af</b></font></a></td>
</tr>
<tr>
<td bgcolor="#000000" height="1"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
</table>
</td>
<td width="1" bgcolor="#000000"><img src="../im/clear.gif"
height="1" width="1"></td>
<td bgcolor="#FFFFFF" width="517" valign="top" height="200">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#B0C4DE" height="15" width="100%"><font
face="Verdana" size="1"
color="#000000"><b> </b></font><b><font
face="Verdana" size="1">Book</font></b></td>
</tr>
<tr>
<td bgcolor="#000000" height="1" width="100%"><img
src="../im/clear.gif" height="1" width="1"></td>
</tr>
</table>
<table border="0" cellpadding="2" cellspacing="0" width="517">
<tr>
<td width="100%"><font face="Verdana" size="1"><br>
<form name="theform" method="POST"
action="<%=Request.ServerVariables("SCRIPT_NAME")%>">
<%
Function Writeln(strOut)
Response.Write strOut & vbCrLf
End Function
'Read page parameters
intID = Trim(Request("ID"))
If Not IsNumeric(intID) Or intID = "" Then intID = 0
intID = CInt(intID)
strMessage = Trim(Request.QueryString("msg"))
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
'Get form values
strName = Request.Form("inpName")
strMonth = Request.Form("inpMonth")
strDay = Request.Form("inpDay")
strYear = Request.Form("inpYear")
strTimeStart = Request.Form("inpTimeStart")
strTimeStop = Request.Form("inpTimeStop")
strCategory = Request.Form("inpCategory")
strLocation = Request.Form("inpLocation")
strBus = Request.Form("inpBuskorsel")
strBooked = Request.Form("inpBooked")
strInstruktor1 = Request.Form("inpInstruktor1")
strInstruktor2 = Request.Form("inpInstruktor2")
strDescription = Request.Form("inpDescription")
Set rstProd = Server.CreateObject("ADODB.Recordset")
If intID = 0 Then
rstProd.Open "EVENTS", conn, adOpenKeyset, adLockOptimistic
rstProd.AddNew
strMessage = strName & " - Tilføjet..."
Else
strSQL = "SELECT * FROM EVENTS WHERE ID=" & intID
rstProd.Open strSQL, conn, adOpenKeyset, adLockOptimistic
strMessage = Server.URLPathEncode(strName & " - Ændringer
gemt...")
End If
'get form values
rstProd("Event_Name") = strName
rstProd("Date_Month") = strMonth
rstProd("Date_Day") = strDay
rstProd("Date_Year") = strYear
rstProd("Date_Time_Start") = strTimeStart
rstProd("Date_Time_Stop") = strTimeStop
rstProd("Category") = strCategory
rstProd("Location") = strLocation
rstProd("Buskorsel") = strBus
rstProd("Booked") = strBooked
rstProd("Instruktor1") = strInstruktor1
rstProd("Instruktor2") = strInstruktor2
rstProd("Description") = strDescription
'Get the (new) ID
intID = rstProd("ID")
'Destroy recordset object
rstProd.Close
rstProd.ActiveConnection = Nothing
Set rstProd = Nothing
Else
End If
strSQL = "SELECT * FROM EVENTS WHERE ID=" & intID
Set rstProd = conn.Execute(strSQL)
If rstProd.EOF Then
strName = ""
strMonth = ""
strDay = ""
strYear = ""
strTimeStart = ""
strTimeStop = ""
strCategory = ""
strLocation = ""
strBus = ""
strBooked = ""
strInstruktor1 = ""
strInstruktor2 = ""
strDescription = ""
Else
strName = rstProd("Event_Name")
strMonth = rstProd("Date_Month")
strDay = rstProd("Date_Day")
strYear = rstProd("Date_Year")
strTimeStart = rstProd("Date_Time_Start")
strTimeStop = rstProd("Date_Time_Stop")
strCategory = rstProd("Category")
strLocation = rstProd("Location")
strBus = rstProd("Buskorsel")
strBooked = rstProd("Booked")
strInstruktor1 = rstProd("Instruktor1")
strInstruktor2 = rstProd("Instruktor2")
strDescription = rstProd("Description")
End If
lstMonth = Listbox("inpMonth", "TblMonth", strMonth , conn)
lstDay = Listbox("inpDay", "TblDay", strDay , conn)
lstYear = Listbox("inpYear", "TblYear", strYear , conn)
lstTimeStart = Listbox("inpTimeStart", "TblTime", strTimeStart ,
conn)
lstTimeStop = Listbox("inpTimeStop", "TblTime", strTimeStop ,
conn)
lstCategory = Listbox("inpCategory", "Categories", strCategory ,
conn)
lstLocation = Listbox("inpLocation", "Location", strLocation ,
conn)
lstBuskoersel = Listbox("inpBudkorsel", "Buskorsel", strBus ,
conn)
lstBooked = Listbox("inpBooked", "Booked", strBooked , conn)
lstInstruktor1 = Listbox("inpInstruktor", "Instruktor",
strInstruktor1 , conn)
lstInstruktor2 = Listbox("inpInstruktor2", "Instruktor",
strInstruktor2 , conn)
rstProd.Close
rstProd.ActiveConnection = Nothing
Set rstProd = Nothing
'Destroy DB connection
conn.Close
Set conn = Nothing
%>
<table border="0" cellpadding="3" cellspacing="0" align="center">
<tr>
<td bgcolor="#C5D3E7"><font face="Verdana" size="1"
color="48576C"><b>Navn </b></font></td>
<td bgcolor="#C5D3E7"><font face="Verdana" size="1"
color="#FF0000"><b></b></font></a></td>
<td bgcolor="#C5D3E7">
<input type="text" name="inpName" class="inputbox" size="45"
value="<%=strName%>" maxlength="255"></td>
</tr>
<tr>
<td bgcolor="#DAE3F0"><font face="Verdana" size="1"
color="48576C"><b>Dato</b></font></td>
<td bgcolor="#DAE3F0"> </td>
<td
bgcolor="#DAE3F0"><%=lstDay%> <%=lstMonth%> <%=lstYear%
></td>
</tr>
<tr>
<td bgcolor="#C5D3E7"><font face="Verdana" size="1"
color="48576C"><b>Tid</b></font><font
size="1" color="#48576C"><b></b></font></td>
<td bgcolor="#C5D3E7"> </td>
<td
bgcolor="#C5D3E7"><%=lstTimeStart%> - <%=lstTimeStop%>
<tr>
<td bgcolor="#DAE3F0"><font size="1"
color="#48576C"><b>Kategori</b></font></td>
<td bgcolor="#DAE3F0"> </td>
<td bgcolor="#DAE3F0"><%=lstCategory%></td>
</tr>
<tr>
<td bgcolor="#C5D3E7" height="34"><font face="Verdana" size="1"
color="48576C"><b>Bane/Sted</b></font></td>
<td bgcolor="#C5D3E7" height="34"> </td>
<td bgcolor="#C5D3E7" height="34"><%=lstLocation%>
</tr>
<tr>
<td bgcolor="#DAE3F0"><font size="1"
color="#48576C"><b>Bus</b></font></td>
<td bgcolor="#DAE3F0"> </td>
<td bgcolor="#DAE3F0"><%=lstBuskoersel%>
</td>
</tr>
<tr>
<td bgcolor="#C5D3E7"><font size="1" color="#48576C"><b>Booket
af</b></font></td>
<td bgcolor="#C5D3E7"> </td>
<td bgcolor="#C5D3E7"><%=lstBooked%>
</td>
</tr>
<tr>
<td bgcolor="#DAE3F0"><font size="1"
color="#48576C"><b>Instruktør 1 </b></font></td>
<td bgcolor="#DAE3F0"> </td>
<td bgcolor="#DAE3F0"><%=lstInstruktor1%>
</td>
</tr>
<tr>
<td bgcolor="#C5D3E7"><font size="1"
color="#48576C"><b>Instruktør 2 </b></font></td>
<td bgcolor="#C5D3E7"> </td>
<td bgcolor="#C5D3E7"><%=lstInstruktor2%>
</td>
</tr>
<tr>
<td bgcolor="#DAE3F0"><font size="1"
color="#48576C"><b>Bemærkning</b></font></td>
<td bgcolor="#DAE3F0"> </td>
<td bgcolor="#DAE3F0"><textarea name="Description"
class="inputbox" cols="45"
rows="5"><%=strDescription%></textarea>
</td>
</tr>
<tr>
<td align="right" valign="bottom"></td>
<td> </td>
<td valign="bottom"><input type="submit" name="Submit"
value="Tilføj aftale" class="inputSubmit">
</td>
</tr>
</table>
</form>
</font></td>
</tr>
</table></td>
<td width="1" bgcolor="#000000"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td height="1" colspan="5" bgcolor="#000000"><img
src="../im/clear.gif" height="1" width="1"></td>
</tr>
<tr>
<td width="1" bgcolor="#000000"><img src="../im/clear.gif"
height="1" width="1"></td>
<td colspan="3" align="center" bgcolor="#B0C4DE" height="30"
valign="top">
<font face="Verdana" size="1"><br><b>©2005 ... Vi
skaber bedre bilister</b></font></td>
<td width="1" bgcolor="#000000"><img src="../im/clear.gif"
height="1" width="1"></td>
</tr>
<tr>
<td height="1" colspan="5" bgcolor="#000000"><img
src="../im/clear.gif" height="1" width="1"></td>
</tr>
</table>
</body>
</html>
<!--#include file="dsn2.asp"-->
Håber på hurtig hjælp.
--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials