?
Solved

ASP Simple Upload

Posted on 2003-03-20
17
Medium Priority
?
535 Views
Last Modified: 2008-03-17
My hosting company "ONLY" supports the use of "Simple Uploads".  Anyone familiar with this?

OK, here is the scoop...I have a ASP job application...then it goes to congratulations.asp

I am getting this error:

ASPSimpleUpload.Upload error 'ASP 0206 : 80004005'

Cannot call BinaryRead

/congratulations.asp, line 78

Cannot call BinaryRead after using Request.Form collection

Here is the code:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>


<%
'creating the databse connection and creating the recordset
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")


'this is declaring the database type.
Dim strDatabaseType
strDatabaseType = "Access"
'strDatabaseType = "MSDE"

'this is telling the JetEngine what driver to use and where the database is located.
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                   "Data Source=d:\html\users\newofficecom\database\EASS.mdb"
                  
'fuction
dim strText
Function text(strText)
   If IsNull(strText) Then Exit Function
   text = Replace(strText, "'", "''")
End Function

'Declare values to be inserted into table - darkmagneto
Dim datec, filename, title, fname, lname
datec = request.form("datec")
filename = Request.Form("filename")
title = request.form("title")
fname = request.form("firstname")
lname = request.form("lastname")
add1 = request.form("address1")
add2 = request.form("address2")
city = request.form("city")
st = request.form("state")
zip = request.form("zip")
hphone = request.form("homephone")
cphone = request.form("cphone")
wphone = request.form("wphone")
email = request.form("email")
besttime = request.form("time")
bestnum = request.form("bestnum")
education = request.form("education")
wpm = request.form("typespeed")
Q1A = request.form("Q1")
Ref1Name = request.Form("refname1")
Ref1Phone = request.Form("refphone1")
Ref1Relation = request.Form("refrelation1")
Ref2Name = request.Form("refname2")
Ref2Phone = request.Form("refphone2")
Ref2Relation = request.Form("refrelation2")
Employer1 = request.Form("employer1")
Job1Start = request.Form("job1from")
Job1Finsih = request.Form("job1to")
Employer2 = request.Form("employer2")
Job2Start = request.Form("job2from")
Job2Finish = request.Form("job2to")
Employer3 = request.Form("employer3")
Job3Start = request.Form("job3from")
Job3Finish = request.Form("job3to")
Start_Date = request.Form("startdate")


                  
'SQL INSERT statement into tblApplicants table inside EASSapplicants.mdb database - darkmagneto.com
Dim strSQL
strSQL = "INSERT INTO tblApplicants (AppDate, Job, Title, First_Name, Last_Name, Address1, Address2, City, State, Zip, Home_Phone, Cell_Phone, Work_Phone, Email_Address, Best_Time, Best_Number, Education, WPM, Q1A, Ref1Name, Ref1Phone, Ref1Relation, Ref2Name, Ref2Phone, Ref2Relation, Employer1, Job1Start, Job1Finish, Employer2, Job2Start, Job2Finish, Employer3, Job3Start, Job3Finish, Start_Date)" & _
         "VALUES ('"&text(datec)&"', '"&text(filename)&"', '"&text(title)&"', '"&text(fname)&"', '"&text(lname)&"', '"&text(add1)&"', '"&text(add2)&"', '"&text(city)&"', '"&text(st)&"', '"&text(zip)&"', '"&text(hphone)&"', '"&text(cphone)&"', '"&text(wphone)&"', '"&text(email)&"', '"&text(besttime)&"', '"&text(bestnum)&"', '"&text(education)&"', '"&text(WPM)&"', '"&text(Q1A)&"', '"&text(Ref1Name)&"', '"&text(Ref1Phone)&"', '"&text(Ref1Relation)&"', '"&text(Ref2Name)&"', '"&text(Ref2Number)&"', '"&text(Ref2Relaion)&"', '"&text(Employer1)&"', '"&text(Job1Start)&"', '"&text(Job1Finish)&"', '"&text(Employer2)&"', '"&text(Job2Start)&"', '"&text(Job2Finish)&"', '"&text(Employer3)&"', '"&text(Job3Start)&"', '"&text(Job3Finish)&"', '"&text(Start_Date)&"')"
objConn.Execute(strSQL)            
%>
<%  
   
 Dim upl, NewFileName
   
 Set upl = Server.CreateObject("ASPSimpleUpload.Upload")
 
 If Len(upl.Form("File1")) > 0 Then
     NewFileName = "/resumes/" & upl.ExtractFileName(upl.Form("File1"))
     If upl.SaveToWeb("File1", NewFileName) Then
         Response.Write("File successfully written to disk.")  
     Else
         Response.Write("There was an error saving the file to disk.")
     End If
 End If
 %>

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="New Office is among the foremost staffing firms in Chicago for temporary and permanent placements. We provide efficient, top-notch staffing support and exciting job placement opportunities. ">
<meta name="keywords" content="advertise, advertising, agency, answer, answers, application, applications, assignment, assignments, career, career information, career test, career testing, career tests, careers, chicago, chicagoland, consult, consultants, consulting, contract, contracts, database, downtown, educate, education, employee, employees, employment, employment agency, employment firm, entry, entry level, entry-level, executive, experience, experienced, firm, headhunter, hire, hiring, Illinois, information, information systems, information technology, interview, interviewee, interviewer, interviews, is, it, java, javascript, job, jobs, loop, new office, new office careers, new office technologies, new office temps, Oracle, perm, permanent, personnel agency, personnel consultant, personnel consultants, personnel firm, personnel firms, personnel service, personnel services, placement, placement agency, placement consultant, placement consultants, placement firm, placement firms, placement service, placement services, position, positions, recruit, recruiter, recruiting, recruiting agencies, recruiting agency, recruiting firm, recruiting firms, recruiting service, recruiting services, recruitment agencies, recruitment agency, recruitment firm, recruitment firms, recruitment service, recruitment services, search, searches, searching, services, services, staff, staffing, staffing agencies, staffing agency, staffing consultant, staffing consultants, staffing firm, staffing firms, support, tech, technologies, technology, technology placement, technology service, technology services, temp, temporaries, temporary, temps, test, tests, testing, train, training, training service, training services, work, working, works, computers, computer training, tech training, technology training">
<title>New Office - Placement agency, careers, staffing and employment in Chicago, IL</title>
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body bgcolor="#EFEFEF" onLoad="MM_preloadImages('img/guaranteea.JPG','img/tempsa.JPG','img/applicationa.JPG','img/jobsa.JPG','img/careersa.JPG','img/locationa.JPG','img/contactsa.JPG','img/clientsgrr.gif')" leftmargin="0" topmargin="0" bottommargin="0" link="#0066FF" vlink="#0066FF" alink="#0066FF">
<table border="0" cellpadding="0" height="78%" width="100%">
  <tr>
    <td rowspan="11" width="145" valign="top">
      <div align="left">
        <table width="100%" border="0" cellpadding="0">
          <tr valign="top">
            <td height="15">
              <div align="right"> <a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','login/img/homea.JPG',1)" href="login/default.htm">
                <img name="Image10" border="0" src="img/homeb.JPG" width="90" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="clients.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','img/clientsgrr.gif',1)">
                <img name="Image12" border="0" src="img/clientsgr.gif" width="101" height="32"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="temps2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image51','','img/tempsa.JPG',1)">
                <img name="Image51" border="0" src="img/tempsb.JPG" width="90" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="application2.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image61','','img/applicationa.JPG',1)">
                <img name="Image61" border="0" src="img/applicationb.JPG" width="140" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="jobs2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image71','','img/jobsa.JPG',1)">
                <img name="Image71" border="0" src="img/jobsb.JPG" width="90" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="careers2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image81','','img/careersa.JPG',1)">
                <img name="Image81" border="0" src="img/careersb.JPG" width="108" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td height="18">
              <div align="right"><a href="guar.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','img/guaranteea.JPG',1)">
                <img name="Image41" border="0" src="img/guaranteeb.JPG" width="126" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="location2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image101','','img/locationa.JPG',1)">
                <img name="Image101" border="0" src="img/locationb.JPG" width="108" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="contacts2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image111','','img/contactsa.JPG',1)">
                <img name="Image111" border="0" src="img/contactsb.JPG" width="108" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><i><font size="2">New Office<br>
                One E. Wacker Drive<br>
                Suite 2400<br>
                Chicago, IL 60601<br>
                Phone: 312.923.0054<br>
                Fax: 312.923.1</font></i><i><font size="2">912</font></i></div>
            </td>
          </tr>
        </table>
      </div>
    </td>
    <td rowspan="12" width="5%">&nbsp;</td>
    <td rowspan="12" width="100%" valign="top">
      <blockquote>
        <p align="center"><img src="img/skylinebg.gif" width="500" height="127"></p>
        <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3"></font></P>
        <p align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Thank
          you. &nbsp;Your information has been received and will be processed
          shortly.</font></P>
     
        <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font color="#333333">When
          you call New Office you always reach a decision-maker! <br>
          Call us today: 312.923.0054</font></b></font></p>
      </blockquote>
      <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
        <br>
        <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="disclaimer2.htm">©Copyright</a>
        1999-2001, New Office Temps, Ltd.</font></p>
    </td>
  </tr>
  <tr>
    <td width="145" valign="top" height="65">
      <div align="right"></div>
    </td>
  </tr>
</table>
<%
'Clean up connection!
objconn.Close
Set objconn = nothing
Set SQLstmt = nothing
%>
</body>
</html>
0
Comment
Question by:darkmagneto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
17 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 8179110
0
 

Author Comment

by:darkmagneto
ID: 8181267
I don't know...I am really bad at ASP and that looks a little over my head!  All I want to do, is upload a file, and be able to rename it to the name the applicant just filled out on the online application.  I also must be able to only let .doc, .pdf and .txt file uploaded and I must be able to limit the size.

Do you think this is possible with this PseudoRequest script stuff?  If so, can you help me?  I am totally lost.

Thanks,
Dark
0
 
LVL 28

Expert Comment

by:sybe
ID: 8181431
Well, the error you get is because you try to "read" the uploaded file after reading out a Request.Form.

The point is that when you use fileupload in asp (no matter how you use it), you will not be able to use Request.Form.

The solution is of course that the "fileupload" object youn will use, will also offer a way to get the other (non-file) values from the form that was posted.

I don't SimpleUpload, so I do not know if it offers this functionality.

But I am sure that PseudoRequestDictionary offers that possibility.

<%
Set oPseudoRequest = new PseudoRequestDictionary
oPseudoRequest.ReadRequest()

title = oPseudoRequest.Item("title")
fname = oPseudoRequest.Item("firstname")
lname = oPseudoRequest.Item("lastname")
' etc

' if you wish to save the file that was upload:

If oPseudoRequest.Item("File1").ContainsFile Then
    sFileName = oPseudoRequest.Item("formfield1").FileName
    sNewFileName = Server.Mappath("/") & "/resumes/" & sFileName
    oPseudoRequest.Item("File1").SaveAs(sNewFileName)
End If

Set oPseudoRequest = Nothing
%>


0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 28

Expert Comment

by:sybe
ID: 8181441
sFileName = oPseudoRequest.Item("formfield1").FileName

should be

sFileName = oPseudoRequest.Item("File1").FileName

<%
Set oPseudoRequest = new PseudoRequestDictionary
oPseudoRequest.ReadRequest()

title = oPseudoRequest.Item("title")
fname = oPseudoRequest.Item("firstname")
lname = oPseudoRequest.Item("lastname")
' etc

' if you wish to save the file that was upload:

If oPseudoRequest.Item("File1").ContainsFile Then
   sFileName = oPseudoRequest.Item("File1").FileName
   sNewFileName = Server.Mappath("/") & "/resumes/" & sFileName
   oPseudoRequest.Item("File1").SaveAs(sNewFileName)
End If

Set oPseudoRequest = Nothing
%>





0
 
LVL 28

Expert Comment

by:sybe
ID: 8181538
>> and I must be able to limit the size.

I forgot that:

<%
Set oPseudoRequest = new PseudoRequestDictionary
oPseudoRequest.ReadRequest()

title = oPseudoRequest.Item("title")
fname = oPseudoRequest.Item("firstname")
lname = oPseudoRequest.Item("lastname")
' etc

' if you wish to save the file that was upload:

iFileSize = oPseudoRequest.Item("File1").FileSize
If iFileSize > 100000 Then
    ' file is bigger then 100,000 bytes
    ' set the limit wherever you want
    Response.write "sorry your file is too big"
    Resonse.End
End If

If oPseudoRequest.Item("File1").ContainsFile Then
  sFileName = oPseudoRequest.Item("File1").FileName
  sNewFileName = Server.Mappath("/") & "/resumes/" & sFileName
  oPseudoRequest.Item("File1").SaveAs(sNewFileName)
End If

Set oPseudoRequest = Nothing
%>








0
 

Author Comment

by:darkmagneto
ID: 8181862
Sybe.....OK  THANKS for all your help...one issue  I get this error...

Microsoft VBScript runtime error '800a01fa'

Class not defined: 'PseudoRequestDictionary'

/congratulations.asp, line 75

Here is my code:  

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>


<%
'creating the databse connection and creating the recordset
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")


'this is declaring the database type.
Dim strDatabaseType
strDatabaseType = "Access"
'strDatabaseType = "MSDE"

'this is telling the JetEngine what driver to use and where the database is located.
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                   "Data Source=d:\html\users\newofficecom\database\EASS.mdb"
                  
'fuction
dim strText
Function text(strText)
   If IsNull(strText) Then Exit Function
   text = Replace(strText, "'", "''")
End Function

'Declare values to be inserted into table - darkmagneto
Dim datec, filename, title, fname, lname
datec = request.form("datec")
filename = Request.Form("filename")
title = request.form("title")
fname = request.form("firstname")
lname = request.form("lastname")
add1 = request.form("address1")
add2 = request.form("address2")
city = request.form("city")
st = request.form("state")
zip = request.form("zip")
hphone = request.form("homephone")
cphone = request.form("cphone")
wphone = request.form("wphone")
email = request.form("email")
besttime = request.form("time")
bestnum = request.form("bestnum")
education = request.form("education")
wpm = request.form("typespeed")
Q1A = request.form("Q1")
Ref1Name = request.Form("refname1")
Ref1Phone = request.Form("refphone1")
Ref1Relation = request.Form("refrelation1")
Ref2Name = request.Form("refname2")
Ref2Phone = request.Form("refphone2")
Ref2Relation = request.Form("refrelation2")
Employer1 = request.Form("employer1")
Job1Start = request.Form("job1from")
Job1Finsih = request.Form("job1to")
Employer2 = request.Form("employer2")
Job2Start = request.Form("job2from")
Job2Finish = request.Form("job2to")
Employer3 = request.Form("employer3")
Job3Start = request.Form("job3from")
Job3Finish = request.Form("job3to")
Start_Date = request.Form("startdate")


                  
'SQL INSERT statement into tblApplicants table inside EASSapplicants.mdb database - darkmagneto.com
Dim strSQL
strSQL = "INSERT INTO tblApplicants (AppDate, Job, Title, First_Name, Last_Name, Address1, Address2, City, State, Zip, Home_Phone, Cell_Phone, Work_Phone, Email_Address, Best_Time, Best_Number, Education, WPM, Q1A, Ref1Name, Ref1Phone, Ref1Relation, Ref2Name, Ref2Phone, Ref2Relation, Employer1, Job1Start, Job1Finish, Employer2, Job2Start, Job2Finish, Employer3, Job3Start, Job3Finish, Start_Date)" & _
         "VALUES ('"&text(datec)&"', '"&text(filename)&"', '"&text(title)&"', '"&text(fname)&"', '"&text(lname)&"', '"&text(add1)&"', '"&text(add2)&"', '"&text(city)&"', '"&text(st)&"', '"&text(zip)&"', '"&text(hphone)&"', '"&text(cphone)&"', '"&text(wphone)&"', '"&text(email)&"', '"&text(besttime)&"', '"&text(bestnum)&"', '"&text(education)&"', '"&text(WPM)&"', '"&text(Q1A)&"', '"&text(Ref1Name)&"', '"&text(Ref1Phone)&"', '"&text(Ref1Relation)&"', '"&text(Ref2Name)&"', '"&text(Ref2Number)&"', '"&text(Ref2Relaion)&"', '"&text(Employer1)&"', '"&text(Job1Start)&"', '"&text(Job1Finish)&"', '"&text(Employer2)&"', '"&text(Job2Start)&"', '"&text(Job2Finish)&"', '"&text(Employer3)&"', '"&text(Job3Start)&"', '"&text(Job3Finish)&"', '"&text(Start_Date)&"')"
objConn.Execute(strSQL)            
%>
<%
dim oPseudoRequest, PseudoRequestDictionary

Set oPseudoRequest = new PseudoRequestDictionary
oPseudoRequest.ReadRequest()

fname = oPseudoRequest.Item("firstname")
lname = oPseudoRequest.Item("lastname")
' etc

' if you wish to save the file that was upload:

iFileSize = oPseudoRequest.Item("File1").FileSize
If iFileSize > 100000 Then
   ' file is bigger then 100,000 bytes
   ' set the limit wherever you want
   Response.write "sorry your file is too big"
   Resonse.End
End If

If oPseudoRequest.Item("File1").ContainsFile Then
 sFileName = oPseudoRequest.Item("File1").FileName
 sNewFileName = Server.Mappath("/") & "/resumes/" & sFileName
 oPseudoRequest.Item("File1").SaveAs(sNewFileName)
End If

Set oPseudoRequest = Nothing
%>

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="New Office is among the foremost staffing firms in Chicago for temporary and permanent placements. We provide efficient, top-notch staffing support and exciting job placement opportunities. ">
<meta name="keywords" content="advertise, advertising, agency, answer, answers, application, applications, assignment, assignments, career, career information, career test, career testing, career tests, careers, chicago, chicagoland, consult, consultants, consulting, contract, contracts, database, downtown, educate, education, employee, employees, employment, employment agency, employment firm, entry, entry level, entry-level, executive, experience, experienced, firm, headhunter, hire, hiring, Illinois, information, information systems, information technology, interview, interviewee, interviewer, interviews, is, it, java, javascript, job, jobs, loop, new office, new office careers, new office technologies, new office temps, Oracle, perm, permanent, personnel agency, personnel consultant, personnel consultants, personnel firm, personnel firms, personnel service, personnel services, placement, placement agency, placement consultant, placement consultants, placement firm, placement firms, placement service, placement services, position, positions, recruit, recruiter, recruiting, recruiting agencies, recruiting agency, recruiting firm, recruiting firms, recruiting service, recruiting services, recruitment agencies, recruitment agency, recruitment firm, recruitment firms, recruitment service, recruitment services, search, searches, searching, services, services, staff, staffing, staffing agencies, staffing agency, staffing consultant, staffing consultants, staffing firm, staffing firms, support, tech, technologies, technology, technology placement, technology service, technology services, temp, temporaries, temporary, temps, test, tests, testing, train, training, training service, training services, work, working, works, computers, computer training, tech training, technology training">
<title>New Office - Placement agency, careers, staffing and employment in Chicago, IL</title>
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body bgcolor="#EFEFEF" onLoad="MM_preloadImages('img/guaranteea.JPG','img/tempsa.JPG','img/applicationa.JPG','img/jobsa.JPG','img/careersa.JPG','img/locationa.JPG','img/contactsa.JPG','img/clientsgrr.gif')" leftmargin="0" topmargin="0" bottommargin="0" link="#0066FF" vlink="#0066FF" alink="#0066FF">
<table border="0" cellpadding="0" height="78%" width="100%">
  <tr>
    <td rowspan="11" width="145" valign="top">
      <div align="left">
        <table width="100%" border="0" cellpadding="0">
          <tr valign="top">
            <td height="15">
              <div align="right"> <a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','login/img/homea.JPG',1)" href="login/default.htm">
                <img name="Image10" border="0" src="img/homeb.JPG" width="90" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="clients.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','img/clientsgrr.gif',1)">
                <img name="Image12" border="0" src="img/clientsgr.gif" width="101" height="32"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="temps2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image51','','img/tempsa.JPG',1)">
                <img name="Image51" border="0" src="img/tempsb.JPG" width="90" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="application2.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image61','','img/applicationa.JPG',1)">
                <img name="Image61" border="0" src="img/applicationb.JPG" width="140" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="jobs2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image71','','img/jobsa.JPG',1)">
                <img name="Image71" border="0" src="img/jobsb.JPG" width="90" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="careers2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image81','','img/careersa.JPG',1)">
                <img name="Image81" border="0" src="img/careersb.JPG" width="108" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td height="18">
              <div align="right"><a href="guar.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','img/guaranteea.JPG',1)">
                <img name="Image41" border="0" src="img/guaranteeb.JPG" width="126" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="location2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image101','','img/locationa.JPG',1)">
                <img name="Image101" border="0" src="img/locationb.JPG" width="108" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><a href="contacts2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image111','','img/contactsa.JPG',1)">
                <img name="Image111" border="0" src="img/contactsb.JPG" width="108" height="36"></a></div>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <div align="right"><i><font size="2">New Office<br>
                One E. Wacker Drive<br>
                Suite 2400<br>
                Chicago, IL 60601<br>
                Phone: 312.923.0054<br>
                Fax: 312.923.1</font></i><i><font size="2">912</font></i></div>
            </td>
          </tr>
        </table>
      </div>
    </td>
    <td rowspan="12" width="5%">&nbsp;</td>
    <td rowspan="12" width="100%" valign="top">
      <blockquote>
        <p align="center"><img src="img/skylinebg.gif" width="500" height="127"></p>
        <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3"></font></P>
        <p align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Thank
          you. &nbsp;Your information has been received and will be processed
          shortly.</font></P>
     
        <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font color="#333333">When
          you call New Office you always reach a decision-maker! <br>
          Call us today: 312.923.0054</font></b></font></p>
      </blockquote>
      <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
        <br>
        <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="disclaimer2.htm">)Copyright</a>
        1999-2001, New Office Temps, Ltd.</font></p>
    </td>
  </tr>
  <tr>
    <td width="145" valign="top" height="65">
      <div align="right"></div>
    </td>
  </tr>
</table>
<%
'Clean up connection!
objconn.Close
Set objconn = nothing
Set SQLstmt = nothing
%>
</body>
</html>
0
 
LVL 28

Expert Comment

by:sybe
ID: 8182228
you have to download the zip files from
http://www.taka.nl/programming/asp/pseudorequest/default.asp

and include the file requestobjects.asp

<!--#include file="requestobjects.asp"-->

see the examples in the downloaded file
0
 

Author Comment

by:darkmagneto
ID: 8182507
OK, now it is this error...

Microsoft VBScript compilation error '800a0411'

Name redefined

/includes/requestobjects.asp, line 12

Class PseudoRequestDictionary
------^
0
 

Author Comment

by:darkmagneto
ID: 8182667
OK, now it is this error...

Microsoft VBScript compilation error '800a0411'

Name redefined

/includes/requestobjects.asp, line 12

Class PseudoRequestDictionary
------^
0
 
LVL 28

Expert Comment

by:sybe
ID: 8182746
here's the error:
You should *not* dim the PseudoRequestDictionary !!

replace the line
dim oPseudoRequest, PseudoRequestDictionary

with
dim oPseudoRequest

0
 

Author Comment

by:darkmagneto
ID: 8182935
Sybe,

Man, I feel so dumb...but now I get this error.

Request object error 'ASP 0206 : 80004005'

Cannot call BinaryRead

/includes/requestobjects.asp, line 116

Cannot call BinaryRead after using Request.Form collection.


Dark
0
 
LVL 28

Expert Comment

by:sybe
ID: 8182994
lol, you sure are not so bright today :)


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="/includes/requestobjects.asp"-->

<%
' catch the posted form values in a special object
Dim oPseudoRequest
Set oPseudoRequest = new PseudoRequestDictionary
oPseudoRequest.ReadRequest()
' now you can no longer user Request.Form("fieldname"),
' in stead use oPseudoRequest.Item("fieldname")

'creating the databse connection and creating the recordset
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")


'this is declaring the database type.
Dim strDatabaseType
strDatabaseType = "Access"
'strDatabaseType = "MSDE"

'this is telling the JetEngine what driver to use and where the database is located.
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                "Data Source=d:\html\users\newofficecom\database\EASS.mdb"
               
'fuction
dim strText
Function text(strText)
  If IsNull(strText) Then Exit Function
  text = Replace(strText, "'", "''")
End Function



'Declare values to be inserted into table - darkmagneto
Dim datec, filename, title, fname, lname

datec = oPseudoRequest.Item("datec")
filename = oPseudoRequest.Item("filename")
title = oPseudoRequest.Item("title")
fname = oPseudoRequest.Item("firstname")
lname = oPseudoRequest.Item("lastname")
add1 = oPseudoRequest.Item("address1")
add2 = oPseudoRequest.Item("address2")
city = oPseudoRequest.Item("city")
st = oPseudoRequest.Item("state")
zip = oPseudoRequest.Item("zip")
hphone = oPseudoRequest.Item("homephone")
cphone = oPseudoRequest.Item("cphone")
wphone = oPseudoRequest.Item("wphone")
email = oPseudoRequest.Item("email")
besttime = oPseudoRequest.Item("time")
bestnum = oPseudoRequest.Item("bestnum")
education = oPseudoRequest.Item("education")
wpm = oPseudoRequest.Item("typespeed")
Q1A = oPseudoRequest.Item("Q1")
Ref1Name = oPseudoRequest.Item("refname1")
Ref1Phone = oPseudoRequest.Item("refphone1")
Ref1Relation = oPseudoRequest.Item("refrelation1")
Ref2Name = oPseudoRequest.Item("refname2")
Ref2Phone = oPseudoRequest.Item("refphone2")
Ref2Relation = oPseudoRequest.Item("refrelation2")
Employer1 = oPseudoRequest.Item("employer1")
Job1Start = oPseudoRequest.Item("job1from")
Job1Finsih = oPseudoRequest.Item("job1to")
Employer2 = oPseudoRequest.Item("employer2")
Job2Start = oPseudoRequest.Item("job2from")
Job2Finish = oPseudoRequest.Item("job2to")
Employer3 = oPseudoRequest.Item("employer3")
Job3Start = oPseudoRequest.Item("job3from")
Job3Finish = oPseudoRequest.Item("job3to")
Start_Date = oPseudoRequest.Item("startdate")


               
'SQL INSERT statement into tblApplicants table inside EASSapplicants.mdb database - darkmagneto.com
Dim strSQL
strSQL = "INSERT INTO tblApplicants (AppDate, Job, Title, First_Name, Last_Name, Address1, Address2, City, State, Zip, Home_Phone, Cell_Phone, Work_Phone, Email_Address, Best_Time, Best_Number, Education, WPM, Q1A, Ref1Name, Ref1Phone, Ref1Relation, Ref2Name, Ref2Phone, Ref2Relation, Employer1, Job1Start, Job1Finish, Employer2, Job2Start, Job2Finish, Employer3, Job3Start, Job3Finish, Start_Date)" & _
        "VALUES ('"&text(datec)&"', '"&text(filename)&"', '"&text(title)&"', '"&text(fname)&"', '"&text(lname)&"', '"&text(add1)&"', '"&text(add2)&"', '"&text(city)&"', '"&text(st)&"', '"&text(zip)&"', '"&text(hphone)&"', '"&text(cphone)&"', '"&text(wphone)&"', '"&text(email)&"', '"&text(besttime)&"', '"&text(bestnum)&"', '"&text(education)&"', '"&text(WPM)&"', '"&text(Q1A)&"', '"&text(Ref1Name)&"', '"&text(Ref1Phone)&"', '"&text(Ref1Relation)&"', '"&text(Ref2Name)&"', '"&text(Ref2Number)&"', '"&text(Ref2Relaion)&"', '"&text(Employer1)&"', '"&text(Job1Start)&"', '"&text(Job1Finish)&"', '"&text(Employer2)&"', '"&text(Job2Start)&"', '"&text(Job2Finish)&"', '"&text(Employer3)&"', '"&text(Job3Start)&"', '"&text(Job3Finish)&"', '"&text(Start_Date)&"')"
objConn.Execute(strSQL)          
%>
<%
dim oPseudoRequest, PseudoRequestDictionary

Set oPseudoRequest = new PseudoRequestDictionary
oPseudoRequest.ReadRequest()

fname = oPseudoRequest.Item("firstname")
lname = oPseudoRequest.Item("lastname")
' etc

' if you wish to save the file that was upload:

iFileSize = oPseudoRequest.Item("File1").FileSize
If iFileSize > 100000 Then
  ' file is bigger then 100,000 bytes
  ' set the limit wherever you want
  Response.write "sorry your file is too big"
  Resonse.End
End If

If oPseudoRequest.Item("File1").ContainsFile Then
    sFileName = oPseudoRequest.Item("File1").FileName
    sNewFileName = Server.Mappath("/") & "/resumes/" & sFileName
    oPseudoRequest.Item("File1").SaveAs(sNewFileName)
End If

%>

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="New Office is among the foremost staffing firms in Chicago for temporary and permanent placements. We provide efficient, top-notch staffing support and exciting job placement opportunities. ">
<meta name="keywords" content="advertise, advertising, agency, answer, answers, application, applications, assignment, assignments, career, career information, career test, career testing, career tests, careers, chicago, chicagoland, consult, consultants, consulting, contract, contracts, database, downtown, educate, education, employee, employees, employment, employment agency, employment firm, entry, entry level, entry-level, executive, experience, experienced, firm, headhunter, hire, hiring, Illinois, information, information systems, information technology, interview, interviewee, interviewer, interviews, is, it, java, javascript, job, jobs, loop, new office, new office careers, new office technologies, new office temps, Oracle, perm, permanent, personnel agency, personnel consultant, personnel consultants, personnel firm, personnel firms, personnel service, personnel services, placement, placement agency, placement consultant, placement consultants, placement firm, placement firms, placement service, placement services, position, positions, recruit, recruiter, recruiting, recruiting agencies, recruiting agency, recruiting firm, recruiting firms, recruiting service, recruiting services, recruitment agencies, recruitment agency, recruitment firm, recruitment firms, recruitment service, recruitment services, search, searches, searching, services, services, staff, staffing, staffing agencies, staffing agency, staffing consultant, staffing consultants, staffing firm, staffing firms, support, tech, technologies, technology, technology placement, technology service, technology services, temp, temporaries, temporary, temps, test, tests, testing, train, training, training service, training services, work, working, works, computers, computer training, tech training, technology training">
<title>New Office - Placement agency, careers, staffing and employment in Chicago, IL</title>
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
 var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
   d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body bgcolor="#EFEFEF" onLoad="MM_preloadImages('img/guaranteea.JPG','img/tempsa.JPG','img/applicationa.JPG','img/jobsa.JPG','img/careersa.JPG','img/locationa.JPG','img/contactsa.JPG','img/clientsgrr.gif')" leftmargin="0" topmargin="0" bottommargin="0" link="#0066FF" vlink="#0066FF" alink="#0066FF">
<table border="0" cellpadding="0" height="78%" width="100%">
 <tr>
   <td rowspan="11" width="145" valign="top">
     <div align="left">
       <table width="100%" border="0" cellpadding="0">
         <tr valign="top">
           <td height="15">
             <div align="right"> <a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','login/img/homea.JPG',1)" href="login/default.htm">
               <img name="Image10" border="0" src="img/homeb.JPG" width="90" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="clients.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','img/clientsgrr.gif',1)">
               <img name="Image12" border="0" src="img/clientsgr.gif" width="101" height="32"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="temps2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image51','','img/tempsa.JPG',1)">
               <img name="Image51" border="0" src="img/tempsb.JPG" width="90" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="application2.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image61','','img/applicationa.JPG',1)">
               <img name="Image61" border="0" src="img/applicationb.JPG" width="140" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="jobs2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image71','','img/jobsa.JPG',1)">
               <img name="Image71" border="0" src="img/jobsb.JPG" width="90" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="careers2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image81','','img/careersa.JPG',1)">
               <img name="Image81" border="0" src="img/careersb.JPG" width="108" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td height="18">
             <div align="right"><a href="guar.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','img/guaranteea.JPG',1)">
               <img name="Image41" border="0" src="img/guaranteeb.JPG" width="126" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="location2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image101','','img/locationa.JPG',1)">
               <img name="Image101" border="0" src="img/locationb.JPG" width="108" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="contacts2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image111','','img/contactsa.JPG',1)">
               <img name="Image111" border="0" src="img/contactsb.JPG" width="108" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><i><font size="2">New Office<br>
               One E. Wacker Drive<br>
               Suite 2400<br>
               Chicago, IL 60601<br>
               Phone: 312.923.0054<br>
               Fax: 312.923.1</font></i><i><font size="2">912</font></i></div>
           </td>
         </tr>
       </table>
     </div>
   </td>
   <td rowspan="12" width="5%">&nbsp;</td>
   <td rowspan="12" width="100%" valign="top">
     <blockquote>
       <p align="center"><img src="img/skylinebg.gif" width="500" height="127"></p>
       <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3"></font></P>
       <p align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Thank
         you. &nbsp;Your information has been received and will be processed
         shortly.</font></P>
     
       <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font color="#333333">When
         you call New Office you always reach a decision-maker! <br>
         Call us today: 312.923.0054</font></b></font></p>
     </blockquote>
     <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
       <br>
       <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="disclaimer2.htm">)Copyright</a>
       1999-2001, New Office Temps, Ltd.</font></p>
   </td>
 </tr>
 <tr>
   <td width="145" valign="top" height="65">
     <div align="right"></div>
   </td>
 </tr>
</table>
<%
'Clean up connection!
objconn.Close
Set objconn = nothing
Set SQLstmt = nothing
Set oPseudoRequest = Nothing

%>
</body>
</html>

0
 
LVL 28

Expert Comment

by:sybe
ID: 8183001
no, that would still generate an error.

Try this:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="/includes/requestobjects.asp"-->

<%
' catch the posted form values in a special object
Dim oPseudoRequest
Set oPseudoRequest = new PseudoRequestDictionary
oPseudoRequest.ReadRequest()
' now you can no longer user Request.Form("fieldname"),
' in stead use oPseudoRequest.Item("fieldname")

'creating the databse connection and creating the recordset
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")


'this is declaring the database type.
Dim strDatabaseType
strDatabaseType = "Access"
'strDatabaseType = "MSDE"

'this is telling the JetEngine what driver to use and where the database is located.
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                "Data Source=d:\html\users\newofficecom\database\EASS.mdb"
               
'fuction
dim strText
Function text(strText)
  If IsNull(strText) Then Exit Function
  text = Replace(strText, "'", "''")
End Function



'Declare values to be inserted into table - darkmagneto
Dim datec, filename, title, fname, lname

datec = oPseudoRequest.Item("datec")
filename = oPseudoRequest.Item("filename")
title = oPseudoRequest.Item("title")
fname = oPseudoRequest.Item("firstname")
lname = oPseudoRequest.Item("lastname")
add1 = oPseudoRequest.Item("address1")
add2 = oPseudoRequest.Item("address2")
city = oPseudoRequest.Item("city")
st = oPseudoRequest.Item("state")
zip = oPseudoRequest.Item("zip")
hphone = oPseudoRequest.Item("homephone")
cphone = oPseudoRequest.Item("cphone")
wphone = oPseudoRequest.Item("wphone")
email = oPseudoRequest.Item("email")
besttime = oPseudoRequest.Item("time")
bestnum = oPseudoRequest.Item("bestnum")
education = oPseudoRequest.Item("education")
wpm = oPseudoRequest.Item("typespeed")
Q1A = oPseudoRequest.Item("Q1")
Ref1Name = oPseudoRequest.Item("refname1")
Ref1Phone = oPseudoRequest.Item("refphone1")
Ref1Relation = oPseudoRequest.Item("refrelation1")
Ref2Name = oPseudoRequest.Item("refname2")
Ref2Phone = oPseudoRequest.Item("refphone2")
Ref2Relation = oPseudoRequest.Item("refrelation2")
Employer1 = oPseudoRequest.Item("employer1")
Job1Start = oPseudoRequest.Item("job1from")
Job1Finsih = oPseudoRequest.Item("job1to")
Employer2 = oPseudoRequest.Item("employer2")
Job2Start = oPseudoRequest.Item("job2from")
Job2Finish = oPseudoRequest.Item("job2to")
Employer3 = oPseudoRequest.Item("employer3")
Job3Start = oPseudoRequest.Item("job3from")
Job3Finish = oPseudoRequest.Item("job3to")
Start_Date = oPseudoRequest.Item("startdate")


               
'SQL INSERT statement into tblApplicants table inside EASSapplicants.mdb database - darkmagneto.com
Dim strSQL
strSQL = "INSERT INTO tblApplicants (AppDate, Job, Title, First_Name, Last_Name, Address1, Address2, City, State, Zip, Home_Phone, Cell_Phone, Work_Phone, Email_Address, Best_Time, Best_Number, Education, WPM, Q1A, Ref1Name, Ref1Phone, Ref1Relation, Ref2Name, Ref2Phone, Ref2Relation, Employer1, Job1Start, Job1Finish, Employer2, Job2Start, Job2Finish, Employer3, Job3Start, Job3Finish, Start_Date)" & _
        "VALUES ('"&text(datec)&"', '"&text(filename)&"', '"&text(title)&"', '"&text(fname)&"', '"&text(lname)&"', '"&text(add1)&"', '"&text(add2)&"', '"&text(city)&"', '"&text(st)&"', '"&text(zip)&"', '"&text(hphone)&"', '"&text(cphone)&"', '"&text(wphone)&"', '"&text(email)&"', '"&text(besttime)&"', '"&text(bestnum)&"', '"&text(education)&"', '"&text(WPM)&"', '"&text(Q1A)&"', '"&text(Ref1Name)&"', '"&text(Ref1Phone)&"', '"&text(Ref1Relation)&"', '"&text(Ref2Name)&"', '"&text(Ref2Number)&"', '"&text(Ref2Relaion)&"', '"&text(Employer1)&"', '"&text(Job1Start)&"', '"&text(Job1Finish)&"', '"&text(Employer2)&"', '"&text(Job2Start)&"', '"&text(Job2Finish)&"', '"&text(Employer3)&"', '"&text(Job3Start)&"', '"&text(Job3Finish)&"', '"&text(Start_Date)&"')"
objConn.Execute(strSQL)          

Dim iFileSize, sFileName, sNewFileName
iFileSize = oPseudoRequest.Item("File1").FileSize
If iFileSize > 100000 Then
  ' file is bigger then 100,000 bytes
  ' set the limit wherever you want
  Response.write "sorry your file is too big"
  Resonse.End
End If

If oPseudoRequest.Item("File1").ContainsFile Then
    sFileName = oPseudoRequest.Item("File1").FileName
    sNewFileName = Server.Mappath("/") & "/resumes/" & sFileName
    oPseudoRequest.Item("File1").SaveAs(sNewFileName)
End If

%>

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="New Office is among the foremost staffing firms in Chicago for temporary and permanent placements. We provide efficient, top-notch staffing support and exciting job placement opportunities. ">
<meta name="keywords" content="advertise, advertising, agency, answer, answers, application, applications, assignment, assignments, career, career information, career test, career testing, career tests, careers, chicago, chicagoland, consult, consultants, consulting, contract, contracts, database, downtown, educate, education, employee, employees, employment, employment agency, employment firm, entry, entry level, entry-level, executive, experience, experienced, firm, headhunter, hire, hiring, Illinois, information, information systems, information technology, interview, interviewee, interviewer, interviews, is, it, java, javascript, job, jobs, loop, new office, new office careers, new office technologies, new office temps, Oracle, perm, permanent, personnel agency, personnel consultant, personnel consultants, personnel firm, personnel firms, personnel service, personnel services, placement, placement agency, placement consultant, placement consultants, placement firm, placement firms, placement service, placement services, position, positions, recruit, recruiter, recruiting, recruiting agencies, recruiting agency, recruiting firm, recruiting firms, recruiting service, recruiting services, recruitment agencies, recruitment agency, recruitment firm, recruitment firms, recruitment service, recruitment services, search, searches, searching, services, services, staff, staffing, staffing agencies, staffing agency, staffing consultant, staffing consultants, staffing firm, staffing firms, support, tech, technologies, technology, technology placement, technology service, technology services, temp, temporaries, temporary, temps, test, tests, testing, train, training, training service, training services, work, working, works, computers, computer training, tech training, technology training">
<title>New Office - Placement agency, careers, staffing and employment in Chicago, IL</title>
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
 var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
   d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body bgcolor="#EFEFEF" onLoad="MM_preloadImages('img/guaranteea.JPG','img/tempsa.JPG','img/applicationa.JPG','img/jobsa.JPG','img/careersa.JPG','img/locationa.JPG','img/contactsa.JPG','img/clientsgrr.gif')" leftmargin="0" topmargin="0" bottommargin="0" link="#0066FF" vlink="#0066FF" alink="#0066FF">
<table border="0" cellpadding="0" height="78%" width="100%">
 <tr>
   <td rowspan="11" width="145" valign="top">
     <div align="left">
       <table width="100%" border="0" cellpadding="0">
         <tr valign="top">
           <td height="15">
             <div align="right"> <a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','login/img/homea.JPG',1)" href="login/default.htm">
               <img name="Image10" border="0" src="img/homeb.JPG" width="90" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="clients.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','img/clientsgrr.gif',1)">
               <img name="Image12" border="0" src="img/clientsgr.gif" width="101" height="32"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="temps2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image51','','img/tempsa.JPG',1)">
               <img name="Image51" border="0" src="img/tempsb.JPG" width="90" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="application2.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image61','','img/applicationa.JPG',1)">
               <img name="Image61" border="0" src="img/applicationb.JPG" width="140" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="jobs2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image71','','img/jobsa.JPG',1)">
               <img name="Image71" border="0" src="img/jobsb.JPG" width="90" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="careers2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image81','','img/careersa.JPG',1)">
               <img name="Image81" border="0" src="img/careersb.JPG" width="108" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td height="18">
             <div align="right"><a href="guar.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','img/guaranteea.JPG',1)">
               <img name="Image41" border="0" src="img/guaranteeb.JPG" width="126" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="location2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image101','','img/locationa.JPG',1)">
               <img name="Image101" border="0" src="img/locationb.JPG" width="108" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><a href="contacts2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image111','','img/contactsa.JPG',1)">
               <img name="Image111" border="0" src="img/contactsb.JPG" width="108" height="36"></a></div>
           </td>
         </tr>
         <tr valign="top">
           <td>
             <div align="right"><i><font size="2">New Office<br>
               One E. Wacker Drive<br>
               Suite 2400<br>
               Chicago, IL 60601<br>
               Phone: 312.923.0054<br>
               Fax: 312.923.1</font></i><i><font size="2">912</font></i></div>
           </td>
         </tr>
       </table>
     </div>
   </td>
   <td rowspan="12" width="5%">&nbsp;</td>
   <td rowspan="12" width="100%" valign="top">
     <blockquote>
       <p align="center"><img src="img/skylinebg.gif" width="500" height="127"></p>
       <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3"></font></P>
       <p align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Thank
         you. &nbsp;Your information has been received and will be processed
         shortly.</font></P>
     
       <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font color="#333333">When
         you call New Office you always reach a decision-maker! <br>
         Call us today: 312.923.0054</font></b></font></p>
     </blockquote>
     <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
       <br>
       <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="disclaimer2.htm">)Copyright</a>
       1999-2001, New Office Temps, Ltd.</font></p>
   </td>
 </tr>
 <tr>
   <td width="145" valign="top" height="65">
     <div align="right"></div>
   </td>
 </tr>
</table>
<%
'Clean up connection!
objconn.Close
Set objconn = nothing
Set SQLstmt = nothing
Set oPseudoRequest = Nothing

%>
</body>
</html>
0
 

Author Comment

by:darkmagneto
ID: 8183150
Sybe,

I still get this error

Request object error 'ASP 0206 : 80004005'

Cannot call BinaryRead

/includes/requestobjects.asp, line 116

Cannot call BinaryRead after using Request.Form collection.

I really need to insert the data via SQL into the database and I need to upload the file.  

Is this possible, or should I change the method?

I really appreciate all of your help!

Dark
0
 
LVL 28

Accepted Solution

by:
sybe earned 200 total points
ID: 8183281
Yes, it is possible what you want.

I'll try to explain one more why you get that error. Please try to understand it.

If you try to read a submitted form, then ASP offers 2 ways to do it. BUT, you can only use one of the 2 methods. If you try to use them both you get errors like you get.

- Method 1 (the normal method)
Using the Request.Form collection.
You do that by code like

<%
MyVariable = Request.Form("myfield")
%>

- Method 2 (this is required for fileupload)
Use the BinaryRead method. This will result in byte-code, which is hard to read.
<%
MyByteVariable = Request.BinaryRead
%>


Now the easy way is method 1. But as said: this does not work with fileupload.
And - I keep repeating - you must choose to use one of the 2 methods.

Since you use fileupload, you *must* use method 2.
Using method 2 it is quite complicated to get the values of the form that was submitted. You do not want to write the code for that. Lucky for you some people have written code that will make it easy for you.

Some of those are fileupload objects that you need to create with
<%
Set Upload = Server.CreateObject(.... fill in something...)
%>
but you need to install the object (component)


Some others are "pure script", and you need to create them with
<%
Set Upload = new .....fill in something....
%>
The good thing about those is that you don't need to install anything on the server. But you'll have to include some code.

But still for both solutions count: they will use Request.BinaryRead, and that means that you can no longer user Request.Form("someformfield")

Now what you do:
you try to use both method 1 and method 2.
You can't.

What I try to tell you is:

1. for fileupload you are stuck with Request.BinaryRead
2. You will not "see" the code with Request.BinaryRead, but it *is* there.
3. You can *not* use Request.Form("something")
4. In stead you need to use something else
5. If you use PseudoRequestDictionary, then you must use something like:

<%
Set oUpload = new PseudoRequestDictionary
oUpload.ReadRequest()

title = oUpload.Item("title")
%>



' if you use
<%
Set oUpload = new PseudoRequestDictionary
oUpload.ReadRequest()
title = Request.Form("title")
' you will get an error -> YOU CAN NOT USE REQUEST.FORM AFTER BINARYREAD
%>


Also if you do this
<%
title = Request.Form("title")
Set oUpload = new PseudoRequestDictionary
oUpload.ReadRequest()
' you will get an error -> YOU CAN NOT USE BINARYREAD AFTER READING REQUEST.FORM
%>











0
 

Author Comment

by:darkmagneto
ID: 8184052
Sybe,

I really appreciate all of your help today!  After talking things over with my boss, I think I am going to stick with the simple ASP that our hosting company "lets" us use.  I know...it sucks, but that is the price you have to pay when you don't host your own site.

Thanks again!

Dark
0
 

Author Comment

by:darkmagneto
ID: 8184053
Sybe,

I really appreciate all of your help today!  After talking things over with my boss, I think I am going to stick with the simple ASP that our hosting company "lets" us use.  I know...it sucks, but that is the price you have to pay when you don't host your own site.

Thanks again!

Dark
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question