Ti posto il codice
Ho remmato alcune parti di codice che mi looppavano l'inser
sembra che ora funzia ma nn vorrei aver toppato in qualche altro modo.
Il codice adesso nascosto te l'ho indicato con i segni *****
codice:
<%
Dim oUpload
Set oUpload= new cUpload
With oUpload
Jet OLEDB:Database Password=" & "prestipino" & ";"
.SetDatabase "Provider=Microsoft.Jet.OLEDB.4.0; " &_
"Data Source="& Server.MapPath("../../database/db.mdb") &"; " &_
"Jet OLEDB:Database Password=" & "MYPASSWORD" & ";","SELECT * FROM AZIENDE"
.EnabledAspUpload = False
.EnabledImageSize = False
.EnabledLog = False
.AutoRename = True
.Overwrite = False
.SetPath "../../images/loghi"
.Load
.MoveFirst
'if .EOF then **********
' NumFiles = .Count() **********
' Response.write "0 Files caricati su " & NumFiles &" : controlla le dimensioni e il tipo di file." **********
'else **********
.Database.Open()
'While Not .EOF **********
.Save
'Inserimento dei valori
.Database.Fields("AZIENDA_NOME") = .Form("nome")
.Database.Fields("AZIENDA_VIA") = .Form("via")
.Database.Fields("AZIENDA_CITTA") = .Form("citta")
.Database.Fields("AZIENDA_PROV") = .Form("prov")
.Database.Fields("AZIENDA_TEL") = .Form("tel")
.Database.Fields("AZIENDA_FAX") = .Form("fax")
.Database.Fields("AZIENDA_WWW") = .Form("www")
.Database.Fields("AZIENDA_MAIL") = .Form("mail")
.Database.Fields("AZIENDA_INFO") = .Form("info")
''''' ho cercato di fare in questo modo ''''''
if .Form("Campo1") <> "" then
str = .Form("Campo1")
arr_str = split(str, "\")
file1 = arr_str(UBound(arr_str))
end if
if .Form("Campo2") <> "" then
str = .Form("Campo2")
arr_str = split(str, "\")
file2 = arr_str(UBound(arr_str))
end if
if .Form("Campo3") <> "" then
str = .Form("Campo3")
arr_str = split(str, "\")
file3 = arr_str(UBound(arr_str))
end if
.Database.Fields("AZIENDA_LOGO") = file1
.Database.Fields("AZIENDA_IMG1") = file2
.Database.Fields("AZIENDA_IMG2") = file3
'Inserimento
.Database.AddNew()
' .MoveNext **********
'Wend **********
'end if **********
End With
Set oUpload = Nothing
response.Redirect "categorie.asp"
%>