Så ser min kod ut: Är databasen felet ligger i. Et endex som inte tillåter dubletter gissar jag på. ;o)Senast besökare problem
<code>
<% '######### LÄGGER IN SOM SENASTE BESÖKARE ###########
If Session("val") = "inloggad" Then
If Session("username") <> Request.Querystring("username") Then
Username = Session("username")
Email = Session("emailadress")
Datum = now
MinEmail = Request.Querystring("email")
Set KT = Connect.Execute("Select * From besok where minemail = '" & Request.Querystring("email") & "' AND email = '" & Session("emailadress") & "'")
If KT.EOF Then
Connect.Execute("Insert Into besok(username,email,datum,minemail) Values('" & Username & "','" & Email & "','" & Datum & "','" & MinEmail & "')")
Else
Connect.Execute("Update besok SET datum='" & Datum & "' where minemail = '" & Request.Querystring("email") & "' AND email = '" & Session("emailadress") & "'")
KT.Close
Set KT = Nothing
End If
End If
End If %>
</code>
Jag får felmeddelandet:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[TCX][MyODBC]Duplicate entry '255' for key 1
/loggain.asp, line 1143
Raden 1143 innehåller:
Connect.Execute("Insert Into besok(username,email,datum,minemail) Values('" & Username & "','" & Email & "','" & Datum & "','" & MinEmail & "')")
Tacksam för svar!
HassanSv: Senast besökare problem