1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Set rsConnection=Server.CreateObject("ADODB.Connection")
rsConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
& " Data Source=" & server.mappath("Flash.mdb") & ";" _
& " Persist Security Info=False"
Set rsRecordset = Server.CreateObject("ADODB.Recordset")
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
mySmartUpload.Upload
strSQL = "INSERT INTO FLASH VALUES (" & maxID & ",'" & mySmartUpload.Form ("Flash_LG") & "','" & mySmartUpload.Form ("Flash_Label") & "','" & mySmartUpload.Form ("Flash_Section") & "'," & mySmartUpload.Form ("Flash_File") & "," & mySmartUpload.Form ("Flash_Datein_Year") & mySmartUpload.Form ("Flash_Datein_Month") & mySmartUpload.Form ("Flash_Datein_Day") & "," & mySmartUpload.Form ("Flash_Dateout_Year") & mySmartUpload.Form ("Flash_Dateout_Month") & mySmartUpload.Form ("Flash_Dateout_Day") & ")"
rsRecordset.Open strSQL, rsConnection, 3
erreur : The connection cannot be used to perform this operation. It is either closed or invalid in this context.
si j'utilise la méthode fournie par le composant
For each file In mySmartUpload.Files
strSQL = "INSERT INTO FLASH VALUES (" & maxID & ",'" & mySmartUpload.Form ("Flash_LG") & "','" & mySmartUpload.Form ("Flash_Label") & "','" & mySmartUpload.Form ("Flash_Section") & "'," & file.FileToField & "," & mySmartUpload.Form ("Flash_Datein_Year") & mySmartUpload.Form ("Flash_Datein_Month") & mySmartUpload.Form ("Flash_Datein_Day") & "," & mySmartUpload.Form ("Flash_Dateout_Year") & mySmartUpload.Form ("Flash_Dateout_Month") & mySmartUpload.Form ("Flash_Dateout_Day") & ")"
rsRecordset.Open strSQL, rsConnection, 3
next |
Partager