Viki il tuo script è molto simile al mio, ma avrei l'esigenza di recuperare il campo Id in un punto ben preciso dello script!
codice:
<%
Dim oUpload
Set oUpload= new cUpload
With oUpload
.SetDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("../../../mdb-database/prodotti.mdb"), "SELECT Top 1 * FROM Articoli"
.EnabledAspUpload = False
.EnabledImageSize = False 'Se impostata a true , vengono calcolate le dimensioni delle immagini.
.EnabledLog = False
.AutoRename = False
.Overwrite = True
.SetPath "../../../public/immagini"
.Load
.UploadOnly "Images"
If Not .EOF then
.Database.Open()
While Not .EOF
.Save
Response.Write "<Div align=""Center"">Il file " & .GetFileName & " è stato inserito correttamente!</Div>
"
Descrizione=Replace(.Form("Descrizione"), VbCrLf, "
")
Descrizione=Replace(Descrizione,"'","''")
Descrizione=Replace(Descrizione, "[", "<")
Descrizione=Replace(Descrizione, "]", ">")
Descrizione=Replace(Descrizione, "URL=", "a href=")
Descrizione=Replace(Descrizione, "/URL", "/a")
Descrizione=Replace(Descrizione, "EMAIL=", "a href=mailto:")
Descrizione=Replace(Descrizione, "/EMAIL", "/a")
.Database.Fields("Descrizione") = Descrizione
.Database.Fields("Prezzo") = .Form("Prezzo")
.Database.Fields("Foto") = .GetHTTPPathFile
.Database.AddNew()
'cambio tabella
.Database.close()
.SetDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("../../../mdb-database/prodotti.mdb"), "SELECT * FROM Categorie"
.Database.Open()
If .Form("Categoria_Tipo") = 2 Then
Categoria = .Form("Categoria")
If Categoria = "" Then
Response.write("<Div align=""center"">Nessuna Categoria inserita!
Torna indietro </Div>")
Else
.Database.Fields("Nome_Categoria") = Categoria
.Database.AddNew()
' Quì dovrei recuperare l'ID
' e memorizzarlo in una variabile!
?????
.Database.close()
End If
ElseIf .......
...............