byt ut ' mot # vid "FeedDate" ... då det är av typen Datum i din databas kanske?
Hej
När jag försöker lägga till feed så får jag fel. Det är så att när man blir vän ska det skapas feed också som t.ex. test och system blev vänner. (Kompisar)
Problemet är att jag får denna felmeddelandet:
error '80020009'
/UsrFriends/FriendsAccept.asp, line 137
Så här ser min kod ut:
<!-- #include file="Inc/DBConnection.asp" --><!-- #include file="Inc/LoginCheck.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="sv">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="copyright" content="">
<title></title>
<link rel="stylesheet" href="_Style/SidansStyle.css" type="text/css">
</head>
<body>
<%
Set ObjRS = ObjConn.Execute("Select * From Friends where FriendAccept='Vänta' and To_UsrID="&SafeSQL(Session("UsrId"))&"")
strSQL = "Select * From TLUsers WHERE UsrID="&SafeSQL(Session("UsrID"))&""
Set ObjRS2 = ObjConn.Execute(strSQL)
ObjConn.Execute("Update TLUsers set UsrLastActive='" & Now & "' where UsrID ="&SafeSQL(Session("UsrID"))&"")
%>
<table cellpadding="0" cellspacing="0" width="705">
<tr>
<td height="5">
<img src="../_Grafik/Profil_Vanster_Uppe.gif" alt="" width="9" height="7"></td>
<td height="7" style="background-image: url('../_Grafik/Profil_Uppe.gif');" width="666"></td>
<td height="5">
<img src="../_Grafik/Profil_Hoger_Uppe.gif" alt="" width="15" height="7"></td>
</tr>
<tr>
<td width="9" style="background-image: url('../_Grafik/Profil_Vanster.gif');" height="525"></td>
<td width="681" height="197">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="23" id="table1">
<tr>
<td width="259" style="background-image: url('../_Grafik/Profil_Meny_Stor.gif');" height="23" style="padding: 3px;">
<%=ObjRS2("UsrTLAlias")%>,
<%=ObjRS2("UsrSex")%> <%
Function Age(datBorn)
Age = DateDiff("yyyy", datBorn, Date())
If (Month(Date()) < Month(datBorn)) or _
(Month(Date()) = Month(datBorn) and Day(Date()) < Day(datBorn)) Then Age = Age -1
End Function
%><%=Age(DateSerial(ObjRS2("UsrAgeYear"), ObjRS2("UsrAgeMonth"), ObjRS2("UsrAgeDay")))%>
från <%=ObjRS2("UsrLiveLoc")%>
</td>
<td width="83" style="background-image: url('../_Grafik/Profil_Meny_Mellan.gif');" height="23">
<img src="../_Grafik/Pix.gif" width="10" height="10">
<a href="../UsrProfile/Profil.asp?UsrID=<%=ObjRS2("UsrID")%>">Profil</a></td>
<td width="83" style="background-image: url('../_Grafik/Profil_Meny_Mellan.gif');" height="23">
<img src="../_Grafik/Pix.gif" width="10" height="10">
<a href="../UsrGuestbook/Guestbook.asp?UsrID=<%=ObjRS2("UsrID")%>">Gästbok</a></td>
<td width="83" style="background-image: url('../_Grafik/Profil_Meny_Mellan.gif');" height="23">
<img src="../_Grafik/Pix.gif" width="10" height="10">
<a href="../UsrFriends/Friends.asp?UsrID=<%=ObjRS2("UsrID")%>">Vänner</a></td>
<td width="83" style="background-image: url('../_Grafik/Profil_Meny_Mellan.gif');" height="23">
<img src="../_Grafik/Pix.gif" width="10" height="10">
<a href="../UsrGallery/Gallery.asp?UsrID=<%=ObjRS2("UsrID")%>">Galleri</a></td>
<td width="90" style="background-image: url('../_Grafik/Profil_Meny_Liten.gif');" height="23">
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="504">
<tr>
<td width="506" height="504" valign="top">
<%
If ObjRS.Eof Then
Response.Redirect "../UsrFriends/Friends.asp?UsrID="&SafeSQL(Session("UsrID"))&""
End if
Response.Write "Folk som du vill acceptera?<br><br>"
Do Until ObjRS.EOF
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="71">
<tr>
<td width="58" height="71">
<img src="../_Grafik/Pix.gif" width="3" height="20"> <td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="58">
<tr>
<td width="259" height="58" valign="top">
<form action="?Friend=Accept&FriendId=<%=Server.HtmlEncode(ObjRS("FriendId"))%>" method="post">
<a href="../UsrProfile/Profil.asp?UsrID=<%=Server.HtmlEncode(ObjRS("From_UsrID"))%>"><%=Server.HtmlEncode(ObjRS("From_TLAlias"))%></a><br>
Skapat för relation? <%=Server.HtmlEncode(ObjRS("FriendType"))%><br>
Träffats: <%=Server.HtmlEncode(ObjRS("FriendMeet"))%><br><br>
Vill du acceptera: <select name="FriendAccept"><option value="Yes" selected>Ja</option><option value="No">Nej</option></select><br><br>
<input type="submit" value="Acceptera"></form>
</td>
</tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0" height="15">
<tr>
<td width="425" height="15" valign="top">
</td>
</tr>
</table>
</td></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="Profil_Linje_Botten">
<img src="../_Grafik/Pix.gif" width="3" height="3"></td>
</tr>
</table>
<%
ObjRS.MoveNext
Loop
%>
<td valign="top" width="2" class="Profil_Linje_Vanster">
</td>
</td>
<td valign="top">
<%
IF Request.Querystring("Friend")="Accept" then
IF Request.Form("FriendAccept")="No" then
ObjConn.Execute("Delete from Friends where FriendId="&SafeSQL(Request.Querystring("FriendId"))&"" & " and To_UsrID="&SafeSQL(Session("UsrID"))&"")
End if
ObjConn.Execute("Update Friends set FriendAccept='"&SafeSQL(Request.Form("FriendAccept"))&"'" & " where FriendId="&SafeSQL(Request.Querystring("FriendId"))&"")
[B]Rad:137[/B] ObjConn.Execute("Insert into tblfeed (feedDate, feed, feeduserId, IP) values ('" & now &"','- <a class=""feedHeaderuserName"" href=""profile/profile.asp?usrId="& ObjRS("From_UsrID") &""">"& ObjRS("From_UsrTLAlias")& "</a> <span class=""feedText"">och</span> <a class=""feedHeaderuserName"" href=""profile/profile.asp?usrId="& ObjRS("To_UsrID") &""">"& ObjRS("To_UsrTLAlias") &"</a> <span class=""feedText"">blev vänner. ("& ObjRS("FriendType") &")</span>',"& ObjRS("From_UsrID") &", '"&SafeSQL(Request.ServerVariables("REMOTE_ADDR"))&"')")
ObjConn.Execute("Insert into tblfeed (feedDate, feed, feeduserId, IP) values ('" & now &"','- <a class=""feedHeaderuserName"" href=""profile/profile.asp?usrId="& ObjRS("To_UsrID") &""">"& ObjRS("To_UsrTLAlias")& "</a> <span class=""feedText"">och</span> <a class=""feedHeaderuserName"" href=""profile/profile.asp?usrId="& ObjRS("From_UsrID") &""">"& ObjRS("From_UsrTLAlias") &"</a> <span class=""feedText"">blev vänner. ("& ObjRS("FriendType") &")</span>',"& ObjRS("To_UsrID") &", '"&SafeSQL(Request.ServerVariables("REMOTE_ADDR"))&"')")
ObjRS.Close : Set ObjRS = Nothing
ObjConn.Close : Set ObjConn = Nothing
Response.Redirect "../UsrFriends/Friends.asp?UsrID="&SafeSQL(Session("UsrId"))&""
End if
%>
</td>
</td>
</tr>
</table>
</td>
<td width="15" style="background-image: url('../_Grafik/Profil_Hoger.gif');" height="197"></td>
</tr>
<tr>
<td height="5">
<img src="../_Grafik/Profil_Vanster_Nere.gif" alt="" width="9" height="6"></td>
<td height="5" style="background-image: url('../_Grafik/Profil_Nere.gif');"></td>
<td height="5">
<img src="../_Grafik/Profil_Hoger_Nere.gif" alt="" width="15" height="6"></td>
</tr>
<tr>
<td height="5">
<img src="../_Grafik/Profil2_Vanster_Nere.gif" alt="" width="9" height="16"></td>
<td height="5" style="background-image: url('../_Grafik/Profil2_Nere.gif');"></td>
<td height="5">
<img src="../_Grafik/Profil2_Hoger_Nere.gif" alt="" width="15" height="16"></td>
</tr>
</table>
</body>
</html>
