|
-
This is the asp page which collects the data from the form and forwards it to the stored query in the DB. (Yes I know its a bit of a mess! it isn't my final one!)
<%
Dim conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("****.mdb") & ";PWD=****"
Dim forumid, emote, subject, postedby, postedon, message, ip, postid, all1, all2
forumid = Request.Form("forumid")
emote = 0
subject = Request.Form("subject")
subject = Replace(subject, Chr(39), Chr(96))
postedby = Request.Form("name")
postedby = Replace(postedby, Chr(39), Chr(96))
postedon = Request.Form("dt")
message = Request.Form("message")
message = Replace(message, Chr(39), Chr(96))
message = Replace(message, Chr(10), "<br>")
ip = Request.Form("ip")
all1 = forumid & ", " & emote & ", ' " & subject & " ', ' " & postedby & " ', ' " & postedon & " ' "
Dim strSQL1
strSQL1 = " qryAddPost " & all1
Dim RS1
Set RS1 = Server.CreateObject("ADODB.Recordset")
RS1.open strSQL1, conn
Dim strSQL2
strSQL2 = "SELECT PostID FROM tblPosts WHERE Subject = ' " & subject & " ' AND ForumID = " & forumid & " AND PostedBy = ' " & postedby & " ' AND PostedOn = ' " & postedon & " ' "
Dim RS2
Set RS2 = Server.CreateObject("ADODB.Recordset")
RS2.open strSQL2, conn
postid = RS2("PostID")
RS2.Close
Set RS2 = Nothing
all2 = postid & ", " & emote & ", ' " & message & " ', ' " & postedby & " ', ' " & postedon & " ', ' " & ip & " ' "
Dim strSQL3
strSQL3 = " qryAddMessage " & all2
Dim RS3
Set RS3 = Server.CreateObject("ADODB.Recordset")
RS3.open strSQL3, conn
Conn.Close
Set Conn = Nothing
Response.Write "Thanks for Posting!<br>"
Response.Write "<a href='showmessages.asp?forumid=" & forumid & "&postid=" & postid & " '>Click to continue</a>"
%>
Err I think that's all u need right?
I can post/send anyone any/all bits of it.
------------------
Microsoft has acknowledged that its engineers substituted certain file names with the phrase, "Netscape engineers are weenies," in some of its internet software.
Oh well now we all know why Nutscrape is so crap!
Bygones!
You only Die once
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|