Fejl i script
Hej.. Nogen som kan se fejlen i dette script ? Den udskriver ingen fejl, men heller ingen html :(--------------------
Create.asp
<%@ Language=VBScript %>
<%Response.Buffer = true %>
<%
If Session("usrID") = "" Then
Response.Redirect "default.asp"
End If
%>
<%
If Not Request.Form("usrName") = "" then
If Not Request.Form("RealName") = "" then
set userConn= Server.CreateObject("ADODB.Connection")
userConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("../wrz.mdb") & ";DriverId=25;FIL=MS Access"
strUsrName = Request.Form("usrName")
strRealName = Request.Form("RealName")
strIcq = Request.Form("Icq")
strAdresse = Request.Form("Address")
strTown = Request.Form("Town")
strPostnr = Request.Form("Postnr")
strUsrStatus = Request.Form("usrStatus")
strTlfnr = Request.Form("Tlfnr")
strAge = Request.Form("Age")
'userConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("../wrz.mdb") & ";DriverId=25;FIL=MS Access;MaxBufferSize=512;PageTimeout=5"
checkSQL = "Select * FROM User Where usrName = '"& strUsrName &"'"
set checkRS=userConn.Execute (checkSQL)
If Not checkRS.EOF And Not checkRS.BOF Then
DoWhat = "Stop"
Else
DoWhat = "Go"
Response.Write "Go!"
End if
'############### En lille forsinkelse....så serveren får tænkt sig om
Sub TLdelaySec(DelaySeconds)
SecCount = 0
Sec2 = 0
While SecCount < DelaySeconds + 1
Sec1 = Second(Time())
If Sec1 <> Sec2 Then
Sec2 = Second(Time())
SecCount = SecCount + 1
End If
Wend
End Sub
TLdelaySec(2)
'############### Forsinkelsen er her 2 sekunder (..TLdelaySec(2) , 2 = antal sek)
If DoWhat="Go" Then
createSQL = "Insert Into User (usrName, RealName, Icq, Address, Town, Postnr, usrStatus, Tlfnr, Age) Values ('"& strUsrName &"', '"& strRealName &"', '"& strIcq &"', '"& strAddress &"', '"& strTown &"', '"& strPostnr &"', '"& strUsrStatus &"', '"& strTlfnr &"', '"& strAge &"')"
set RS=userConn.Execute (createSQL)
Response.Redirect "admin.asp"
Else
%>
<html>
<head>
<link rel="stylesheet" href="/styles.css">
<title>Fejl</title>
</head>
<BODY bgcolor="#FFFFFF">
Der opstod en fejl:<br>
Du kan ikke bruge dette navn, det er allerede taget!.<br>
<a href="" onClick="java script:history.back()">Tilbage</a>
<FONT FACE=Arial>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#3399FF">
<td><b>Create Member</b></td>
</tr>
</table>
<form method="post" action="create.asp">
<table width="274" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="94" bgcolor="#C0C0C0"> User Name</td>
<td width="176" bgcolor="#C0C0C0">
<input type="text" name="usrName" size="24">
</td>
</tr>
<tr>
<td width="94" bgcolor="#C0C0C0"> Real Name</td>
<td width="176" bgcolor="#C0C0C0">
<input type="text" name="RealName" size="24">
</td>
</tr>
<tr>
<td width="94" bgcolor="#C0C0C0"> Address</td>
<td width="176" bgcolor="#C0C0C0">
<input type="text" name="Address" size="24">
</td>
</tr>
<tr>
<td width="94" bgcolor="#C0C0C0"> Town</td>
<td width="176" bgcolor="#C0C0C0">
<input type="text" name="Town" size="24">
</td>
</tr>
<tr>
<td width="94" bgcolor="#C0C0C0"> Area Code</td>
<td width="176" bgcolor="#C0C0C0">
<input type="text" name="Areacode" size="24">
</td>
</tr>
<tr>
<td width="94" bgcolor="#C0C0C0"> ICQ</td>
<td width="176" bgcolor="#C0C0C0">
<input type="text" name="Icq" size="24">
</td>
</tr>
<tr>
<td width="94" bgcolor="#C0C0C0"> Age</td>
<td width="176" bgcolor="#C0C0C0">
<input type="text" name="Age" size="24">
</td>
</tr>
<tr>
<td width="94" bgcolor="#C0C0C0"> Phone number</td>
<td width="176" bgcolor="#C0C0C0">
<input type="text" name="Tlfnr" size="24">
</td>
</tr>
<tr>
<td width="94" bgcolor="#C0C0C0"> User Status</td>
<td width="176" bgcolor="#C0C0C0">
<input type="text" name="usrStatus" size="24">
</td>
</tr>
<tr>
<td width="94" bgcolor="#C0C0C0"> </td>
<td width="176" bgcolor="#C0C0C0">
<div align="right">
<input type="submit" name="Submit">
</div>
</td>
</tr>
</table>
</form>
</FONT>
</body>
</html>
<%
end if
end if
else
%>
<% end if %>
------------------------