<%
' Variables
' *********
Dim mySmartUpload
' Dim intCount
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
Set skapamapp = mySmartUpload.Form("Username")
' Save the files with their original names in a virtual path of the web server
' ****************************************************************************
intCount = mySmartUpload.Save("/Katalog/Images/" & skapamapp)
' sample with a physical path
' intCount = mySmartUpload.Save("c:\temp\")
'Declare all local variables
dim conn
dim rs
dim strID
dim strconn
'set a local variable to my DSN-less connection String
strconn = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\data\WebData\katalog.mdb;"
'Create the Connection object
set conn = server.createobject("adodb.connection")
conn.open strconn
'Create the recordset object
set rs = server.createobject("adodb.recordset")
'This statement opens the table so we can add a record notice the addnew
'The 2, 2 is how the table is opened there are many ways it can be opened
SQL = "SELECT * from Kat WHERE ID = " & mySmartUpload.Form("ID") & ""
rs.open sql, conn, 2, 2, adCmdText
'Set the table column = to my input text box from my form
rs("Filename") = mySmartUpload.Files.Item(1).FileName
rs("produktbild") = mySmartUpload.Files.Item(2).FileName
rs.update
'Always! Always set your objects to nothing. This clears them out of servers memory
'Your network admins will like this
%>
<!--#include file="include.asp"-->
<%
set rs= nothing
set conn = nothing
%>
Vad jag vill ha är en if sats som gör så att om:
rs("produktbild") = mySmartUpload.Files.Item(2).FileName
rs.update
Så är tom, alltså ingenting skickades, så då ska den inte köras, går det att göra såhär kanske?
IF mySmartUpload.Files.Item(2).FileName = "" then
Else
rs("produktbild") = mySmartUpload.Files.Item(2).FileName
rs.update
End if
Skulle det kanske funka?
------------------
His Divine Shadow is the most despicable being ever created, short and to the point.