Problemer med ASP & Access Database
Hej.Jeg har et problem med noget ASP som jeg har siddet og kodet.
Jeg har to sider + en access database. En hvor listen med dem som har tilmeldt sig og en hvor man tilmelder sig på listen.
Siden, hvor man tilmelder sig på listen melder ingen fejl og det samme er med listen, hvor man kan se de tilmeldte. Problemet er bare er at en eller anden grund så forstår databasen ikke at tage imod data fra formen.
Note: Jeg er ikke den store haj til ASP
siden med formen:
<!-- #INCLUDE FILE="adovbs.inc" -->
<%
Response.Buffer = True
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
Response.Cookies("Liste")("Navn") = Request.Form("Navn")
Response.Cookies("Liste")("Adresse") = Request.Form("Adresse")
Response.Cookies("Liste")("Uddannelsested") = Request.Form("Uddannelsested")
Response.Cookies("Liste")("Fodt") = Request.Form("Fodt")
Response.Cookies("Liste").Expires = Date+365
End If
Navn = Request.Cookies("Liste")("Navn")
Adresse = Request.Cookies("Liste")("Adresse")
Uddannelsested = Request.Cookies("Liste")("Uddannelsested")
Fodt = Request.Cookies("Liste") ("Fodt")
%>
<%
tempConn = "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/mrfusker/db/liste.mdb") & ";UID=admin;PWD=;"
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
Navn = Trim(Request.Form("Navn"))
Adresse = Trim(Request.Form("Adresse"))
Uddannelsested = Trim(Request.Form("Uddannelsested"))
Fodt = Trim(Request.Form("Fodt"))
Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM Liste WHERE (ID = 0)"
rs.Open strSQL, tempConn, adOpenKeyset, adLockOptimistic
If (rs.BOF Or rs.EOF) Then
rs.AddNew
rs("Navn") = Navn
rs("Adresse") = Adresse
rs("Uddannelsested") = Uddannelsested
rs("Fodt") = Fodt
rs.Update
End If
rs.Close
Set rs = Nothing
End If
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
Response.Redirect("r_rammfans.asp")
End If
%>
<html>
<head>
<title>The World List of Rammstein Fans</title>
<style fprolloverstyle>
a:link { text-decoration: none; font-size: 10; font-family: verdana; color: black }
a:visited { text-decoration: none; font-size: 10; font-family: verdana; color: black }
a:active { text-decoration: none; font-size: 10; font-family: verdana; color: black }
a:hover { text-decoration: none; font-size: 10; font-family: Verdana; color: black }
</style>
</head>
<form method="POST" action="r_addlist.asp">
<center><img src="/mrfusker/images/esgibt.jpg"></center>
<div align="center"><center><table border="0" cellpadding="2"
cellspacing="0" width="50%">
<tr>
<td align="right" width="20%"><font face="Verdana" color="black" size="-2"><b>Name:</b></font></td>
<td colspan="2" width="80%"><font size="-2"
face="Verdana"><input type="text" size="80"
name="Navn"></font></td>
</tr>
<tr>
<td align="right" width="20%"><font size="-2" face="Verdana"><b>Birthdate</b></font><font face="Verdana" color="black" size="-2"><b>:</b></font></td>
<td colspan="2" width="80%"><font size="-2"
face="Verdana"><input type="text" size="80"
name="Fodt"></font></td>
</tr>
<tr>
<td align="right" width="20%"><font face="Verdana" color="black" size="-2"><b>Location:</b></font></td>
<td colspan="2" width="80%"><font size="-2"
face="Verdana"><input type="text" size="80"
name="Adresse"></font></td>
</tr>
<tr>
<td align="right" width="20%"><font face="Verdana" color="black" size="-2"><b>Country:</b></font></td>
<td colspan="2" width="80%"><font size="-2"
face="Verdana"><input type="text" size="80"
name="Uddannelsessted"></font></td>
</tr>
</table>
</center></font>
<p align="center"><font face="Verdana" size="1"><b>Name:</b> </font><font size="-2"
face="Verdana">Your full name. Please place your nickname after your full name
in a ( ). (Thomas Nielsen (ZornSlog), Maria Hansen (MarHan) etc.)<br>
<b>Birthdate (DD/MM/YYYY): </b></font><font size="-2"
face="Verdana">Your birthdate (01/01/1960, 06/12/1980 etc.)<br>
<b>Location: </b></font><font size="-2"
face="Verdana">Your hometown (Kjellerup, Berlin, Copenhagen etc.)<br>
<b>Country: </b></font><font size="-2"
face="Verdana">Your Country (Germany, Denmark, France etc.)</font></p>
<p align="center"><font face="Verdana" size="-2">Please use the 'tabulator'
to change between the fields!</font></p>
<input type="submit"
name="B1" style="font-family: Verdana; font-size: -2; font-weight:bold; color:black; background-image:url('knap.jpg')" value="Submit"><input type="reset" style="font-family: Verdana;
font-size: -2; color:black; font-weight:bold; background-image:url('knap.JPG')" value="Reset" name="B2"</p>
<p align="center">
</form>
</BODY>
</html>
siden med listen:
<%@ Language=VBScript %>
<head>
<title>The World List of Rammstein Fans</title>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="DESCRIPTION" CONTENT="Tribute to the best music band ever">
<meta name="KEYWORDS" content="rammstein kannibal cannibal music list musik musikka world great fine fantastic till lindemann richard z kruspe flake schneider danish mrfusker swedish english">
<meta name="OWNER" content="mrfusker@hotmail.com">
<meta name="AUTHOR" content="Mr. Fusker">
<meta name="page-TOPIC" content="Music">
<meta name="AUDIENCE" content="All">
<meta name="RATING" content="General">
<meta name="ROBOTS" content="index,follow">
<meta name="REVISIT-AFTER" content="1 days">
<style fprolloverstyle>
a:link { text-decoration: none; font-size: 10; font-family: verdana; color: black }
a:visited { text-decoration: none; font-size: 10; font-family: verdana; color: black }
a:active { text-decoration: none; font-size: 10; font-family: verdana; color: black }
a:hover { text-decoration: none; font-size: 10; font-family: Verdana; color: black }
</style>
</head>
<body style="font-family: Verdana" link="black" vlink="black" alink="black" bgcolor="white">
<body>
<center><img src="/mrfusker/images/esgibt.jpg"></center>
<center><font size="-2">The list started 16.04.2005</center>
<p align="center"><a href="r_addlist.asp">I'm a Rammstein Fan and I would like to be
added! (Click here)</a><br>
<a href="mailto:mrfusker@hotmail.com?subject=Problems... help me!">Problems?
Mail me at: mrfusker@hotmail.com</a><br>
<a target="_blank" href="r_point.txt">The point of the list! (Open in a new
window)</a><br>
<!--#include file=Paging_Inc.asp-->
<%
dim Rst
set Rst=server.CreateObject("ADODB.recordset")
Rst.Open "select * from liste ORDER BY ID DESC",Connect,3,1,1
if Rst.EOF =true then
Response.Write "No Records Avialable in the Database"
else
dim intPageSize,PageIndex,TotalPages
dim RecordCount,RecordNumber,Count
intpageSize=50
PageIndex=request("PageIndex")
if PageIndex="" then PageIndex=1
RecordCount=Rst.RecordCount
RecordNumber=(intPageSize * PageIndex) - intPageSize
Rst.PageSize =intPageSize
Rst.AbsolutePage = PageIndex
TotalPages=Rst.PageCount
dim intPrev,intNext
intPrev=PageIndex - 1
intNext=PageIndex +1
Count=1
Response.Write "<table align=left width=629>"
Response.Write "<tr bgcolor=white align=left><th>Name:</th><th>Location:</th><th>Country:</th><th>Birthday:</th><th>Number:</th></tr>"
while not Rst.EOF and Count<=intPageSize
if Count mod 2 <>0 then
Response.Write "<tr bgcolor=lightblue><td <font face=Verdana color=black size=-2>" & Rst.Fields(0) & "</td><td>" & Rst.Fields(1) & "</td><td>" & Rst.Fields(2) & "</td><td>" & Rst.Fields(3) & "</td><td>" & Rst.Fields(4) & "</td></tr>"
else
Response.Write "<tr bgcolor=white><td>" & Rst.Fields(0) & "</td><td>" & Rst.Fields(1) & "</td><td>" & Rst.Fields(2) & "</td><td>" & Rst.Fields(3) & "</td><td>" & Rst.Fields(4) & "</td></tr>"
end if
Rst.MoveNext
Count=Count + 1
wend
Response.Write "</table>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
Response.Write "<p> </p>"
call button(intPrev,intNext,TotalPages)
set Rst=nothing
Connect.close
end if
%>
</body>