Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Langages serveur > ASP
ASP Forum sur la programmation ASP. Avant de poster : Cours ASP, FAQ ASP
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 02/09/2007, 15h32   #1
Invité régulier
 
Inscription : avril 2007
Messages : 52
Détails du profil
Informations forums :
Inscription : avril 2007
Messages : 52
Points : 7
Points : 7
Par défaut Upload fichier + information vers BD access

Je travaille sur ce code
Mais à l'excution j'ai ce message d'erreur, et je ne comprend pas

Error Type:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
/abc/resultspage.asp, line 66

Citation:
<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("/mydatabase.mdb") & ";"
objConn.Open
%>
<%
DIM objRSr, File, Upload, Count, Ext
DIM Mail, strMsgHeader
Set Upload = Server.CreateObject("Persits.Upload.1")
Count = Upload.SaveVirtual("/contactus/hr/upload/")

IF NOT Count=0 THEN
FOR EACH File IN Upload.Files
Ext = UCase(Right(File.Path, 3))
IF Ext <> "TXT" AND Ext <> "DOC" THEN
Response.Write Upload.Form("FirstName") & ",<br><br>"
Response.Write "Sorry, your resume " & File.Path & " is not in a .DOC or .TXT format and has not been delivered through our system. Please save your resume in one of these formats and resubmit it."
File.Delete
ELSE

Set objRSr = Server.CreateObject("ADODB.Recordset")
objRSr.Open "tblContact", objConn, , adLockOptimistic, adCmdTable

objRSr.AddNew
objRSr("Data") = "Resumes"
objRSr("Email") = Upload.Form("Email")
objRSr("FirstName") = Upload.Form("FirstName")
objRSr("LastName") = Upload.Form("LastName")
objRSr("Position") = Upload.Form("Position")
objRSr("Comments") = Upload.Form("Comments")
objRSr("DateSubmitted") = Date()
Set File = Upload.Files("fResume")
If Not File Is Nothing Then objRSr("fResume").Value = File.Binary
objRSr.Update

objRSr.Close
Set objRSr = Nothing


Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail.YOUR_DOMAIN_NAME_HERE.com"
Mail.From = Upload.Form("Email")
Mail.AddAddress "YOUR_EMAIL_ADDRESS_HERE"
Mail.Subject = "Resume"
strMsgHeader = "This email was delivered from your website." & vbCrLf & vbCrLf
Mail.Body = strMsgHeader & "Email: " & Upload.Form("Email") & vbCrLf & "First Name: " & Upload.Form("FirstName") & vbCrLf & "Last Name: " & Upload.Form("LastName") & vbCrLf & "Position: " & Upload.Form("Position") & vbCrLf & vbCrLf & "Comments: " & Upload.Form("Comments")

IF Count > 0 THEN
Mail.AddAttachment Upload.Files(1).Path

On Error Resume Next
Mail.Send
IF Err <> 0 THEN
Response.Write "There was an error sending your message. Please visit our Contact Us page and send a message to our Webmaster to report this error: <B>" & Err.Description & "</B>"
ELSE
Response.Write Upload.Form("FirstName") & ","
Response.Write "<p>Thank you for contacting our recruiter. Your resume has been received and will be reviewed shortly. If we have a position is available that matches your skills, we will contact you to schedule an interview. We keep all resumes on file for a period of 6 months, please feel free to resubmit your resume after this time for future consideration.</p>"
File.Delete
END IF
END IF
END IF

NEXT
%>

<P>
<%
' This is a nice way to Personalize your FORM.
' It disPlays the Persons name before your message.
strName = Request.Form("FirstName")
Response.Write strFirstName
%>,</P>

<P>Thank you for emailing us your resume.</P>


et merci d'avance
naouah est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/09/2007, 17h58   #2
Membre chevronné
 
Avatar de ryan
 
Inscription : juin 2003
Messages : 766
Détails du profil
Informations forums :
Inscription : juin 2003
Messages : 766
Points : 760
Points : 760
Yop!

C'est un NEXT qui correspond à ton "IF NOT Count=0 THEN", c'est normal que ça ne fonctionne pas...
ryan est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 00h10.


 
 
 
 
Partenaires

Hébergement Web