Forums

ASP

This topic is locked

insertion not working

Posted 11 Dec 2006 11:54:42
1
has voted
11 Dec 2006 11:54:42 mermaid1 mermaid1 posted:
dear friends.
am uploading files that are related to newsletter table. the file upload works fine. but the File_ID is not being sent to the File_ID field in the newsletter table. here is part of the code for the file upload. the insertion of details in the Files table works well.but the File_ID is not sent to newsletter table. plz help.


Dim FN
Dim FL
Dim PID
FN = Request.Form("FN"
FL = Request.Form("FL"

PID = Request.Form("PID"
Usr = Session("MM_Username"

FURL = "Files/"&FN

objFiles.Open "Insert INTO Files(File_NameURL, File_URL, File_Size, Date_Uploaded, Uploaded_By, News_Edition)"_
& " Values ('" & FN & "','" & FURL & "','" & FL & "','" & Date() & "', '" & Session("MM_Username" & "','" & PID & "')", objConn

objFLetter.Open "Select * FROM Files ORDER BY File_ID ASC", objConn

While NOT objFLetter.EOF
Dim FileID
FileID = objFLetter("File_ID"
objFLetter.Movenext
Wend



If Request.QueryString("src"="NewsFile" THEN

PID = Request.Form("PID"



objN1.Open "Select a.*, b.* FROM Newsletter a INNER JOIN Files b ON NL_Edition=News_Edition WHERE NL_Edition="& PID &"", objConn


While NOT objN1.EOF

Dim NewsID
NewsID = objN1("NL_ID"
Dim FileID2
FileID2 = objN1("b.File_ID"
wend

objNewsFile.Open "Update Newsletter Set "_
&"File_ID = '" & FileID2 & "'"_
&"where NL_ID ='"& NewsID &"'", objConn
Response.Redirect("File_Upload3.asp?FN=" & FN & "&PID=" & PID & ""
End If

Response.Redirect("File_Upload3.asp?FN=" & FN & "&PID=" & PID & ""

%>

Reply to this topic