this question is related to this (answered yesterday):
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21918804.html
i thought i tested it but apparently something fell through the cracks!
i'm not able to update an existing record - so if i have a record who's ContentID is 65 and i try to update the filename in in the db when i do my upload to the server, taint happening- if there's no filename the filename doesn't get added to the existing record - here's my code:
<!-- AspUpload Code samples: odbc_upload.asp -->
<!-- Invoked by odbc.asp -->
<!-- Copyright (c) 2001 Persits Software, Inc. -->
<!--
http://www.persits.com -->
<HTML>
<BODY>
<%
Set Upload = Server.CreateObject("Persi
ts.Upload"
)
' Capture files
Upload.Save "E:\inetpub\wwwroot\smbb\n
ewsite\new
s\pdfs\"
' Obtain file object
Set File = Upload.Files("THEFILE")
For Each File in Upload.Files
datapath="E:\inetpub\wwwro
ot\smbb\sm
bb.mdb"
strConn="Provider=Microsof
t.Jet.OLED
B.4.0;Data
Source=" & datapath
Set objConn = Server.CreateObject("ADODB
.Connectio
n")
objConn.Open strConn
set rs = Server.CreateObject("ADODB
.RecordSet
")
Dim rsContentID__MMColParam
rsContentID__MMColParam = "ContentID"
SQL = "SELECT * FROM Content WHERE ContentID = " + Replace(rsContentID__MMCol
Param, "'", "''") + ""
rs.Open SQL,objConn,1,2
if rs.eof then
rs.AddNew
end if
rs("filename") = File.ExtractFileName
rs.Update
rs.Close
set rs = nothing
objConn.Close
set objConn = nothing
Response.Write "Your PDF has been successfully uploadedd. <a href='index.asp'>Click here</a> to return to the admin."
Next
%>
</BODY>
</HTML>
Thanks!!!
What's this mean? No filename? Why would you have that?
Also, may want to check your database to see if records are being added...because will do that is EOF.