Forums
This topic is locked
Mail Uploaded File Extension Error
Posted 10 Nov 2005 20:29:56
1
has voted
10 Nov 2005 20:29:56 Greg Kresslein posted:
I am trying to use the mail uploaded file extension as part of a form. When I do, and try to use dynamic variables in the option box for the sender's name and email, I get the following error in my browser:ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/quote/index2.asp, line 177
If I remove the dynamic data in the mail uploaded file options box, the attachment is emailed and uploaded fine, but no record is inserted into the database, and no other information is sent in the email, like the pertinent contact information.
Any help is greatly appreciated.
Replies
Replied 11 Nov 2005 18:40:32
11 Nov 2005 18:40:32 myke black replied:
could you please paste the code you are using into your post and we'll have a look and see where its going wrong,
thanks
thanks
Replied 11 Nov 2005 21:14:27
11 Nov 2005 21:14:27 Greg Kresslein replied:
<!--#include file="../Connections/strousequote.asp" -->
<!--#include file="../ScriptLibrary/incPUAddOn.asp" -->
<!--#include file="../ScriptLibrary/incPureUpload.asp" -->
<%
'*** Pure ASP File Upload 2.2.0
Dim GP_uploadAction,UploadQueryString
PureUploadSetup
If (CStr(Request.QueryString("GP_upload") <> "" Then
Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout,pau_progressBar,pau_progressWidth,pau_progressHeight
pau_thePath = """attachments"""
pau_Extensions = ""
pau_Form = "form1"
pau_Redirect = ""
pau_storeType = "file"
pau_sizeLimit = ""
pau_nameConflict = "over"
pau_requireUpload = "false"
pau_minWidth = ""
pau_minHeight = ""
pau_maxWidth = ""
pau_maxHeight = ""
pau_saveWidth = ""
pau_saveHeight = ""
pau_timeout = "600"
pau_progressBar = "YellowFlashProgress.htm"
pau_progressWidth = "300"
pau_progressHeight = "100"
Dim RequestBin, UploadRequest
CheckPureUploadVersion 2.20
ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout
end if
%>
<%
' *** Edit Operations: (Modified for File Upload) declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")
If (UploadQueryString <> "" Then
MM_editAction = MM_editAction & "?" & UploadQueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: (Modified for File Upload) set variables
If (CStr(UploadFormRequest("MM_insert") = "form1" Then
MM_editConnection = MM_strousequote_STRING
MM_editTable = "quotes"
MM_editRedirectUrl = ""
MM_fieldsStr = "first|value|last|value|position|value|company|value|address|value|city|value|state|value|zip|value|country|value|email|value|phone|value|fax|value|how|value|jobdesc|value|drawing_available|value|availablehow|value|file|value|length|value|lengthselect|value|width|value|widthselect|value|height|value|heightmenu|value|tolerance|value|cores|value|coreid|value|odlimitations|value|suppliedin|value|liner|value|liner1|value|liner2|value|liner_spec|value|quantities|value|monthlyest|value|annualreq|value|onetime|value|onetimemenu|value|comments|value|send_samples|value|salescall|value"
MM_columnsStr = "quotefirst|',none,''|quoteast|',none,''|quoteposition|',none,''|company|',none,''|address|',none,''|city|',none,''|state|',none,''|zip|',none,''|country|',none,''|email|',none,''|phone|',none,''|fax|',none,''|quotehow|',none,''|jobdesc|',none,''|drawingavailable|',none,''|availablehow|',none,''|quotefile|',none,''|quotelength|',none,''|lengthselect|',none,''|quotewidth|',none,''|widthselect|',none,''|quoteheight|',none,''|heightmenu|',none,''|tolerance|',none,''|quotecores|',none,''|quotecoreid|',none,''|odlimitations|',none,''|suppliedin|',none,''|quoteliner|',none,''|liner1|',none,''|liner2|',none,''|linerspec|',none,''|quantities|',none,''|monthlyest|',none,''|annualreq|',none,''|quoteonetime|',none,''|onetimemenu|',none,''|comments|',none,''|sendsamples|',none,''|salescall|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(UploadFormRequest(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And UploadQueryString <> "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And UploadQueryString <> "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & UploadQueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & UploadQueryString
End If
End If
End If
%>
<%
' *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
If (CStr(UploadFormRequest("MM_insert") <> "" Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),","
MM_delim = MM_typeArray(0)
If (MM_delim = "none" Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none" Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none" Then MM_emptyVal = ""
If (MM_formVal = "" Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "" Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'" Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''" & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & " values (" & MM_dbValues & ""
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_strousequote_STRING
Recordset1.Source = "SELECT * FROM quotes"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
' *** Mail Uploaded Files 1.7.0
If (CStr(Request.QueryString("GP_upload") <> "" Then
Dim MUF_path, MUF_FromName, MUF_FromEmail, MUF_ToName, MUF_ToEmail, MUF_Bcc, MUF_Subject, MUF_Body, MUF_SendHtml, MUF_checkErrors, MUF_deleteFiles, MUF_RedirectURL, MUF_SmtpServer, MUF_MailerType
MUF_path = "attachments"
MUF_FromName = "Web Site"
MUF_FromEmail = Recordset1.Fields.Item("email".Value
MUF_ToName = "Brian Holz"
MUF_ToEmail = " "
MUF_Bcc = ""
MUF_Subject = "Quote Request from Strouse.com"
MUF_Body = "Quote request"
MUF_SendHtml = false
MUF_checkErrors = true
MUF_deleteFiles = false
MUF_RedirectURL = "/quote/thanks2.asp"
MUF_SmtpServer = ""
MUF_MailerType = "CDO"
MailUploadedFiles MUF_path, MUF_FromName, MUF_FromEmail, MUF_ToName, MUF_ToEmail, MUF_Bcc, MUF_Subject, MUF_Body, MUF_SendHtml, MUF_checkErrors, MUF_deleteFiles, MUF_RedirectURL, MUF_SmtpServer, MUF_MailerType
end if
%>
<!--#include file="../ScriptLibrary/incPUAddOn.asp" -->
<!--#include file="../ScriptLibrary/incPureUpload.asp" -->
<%
'*** Pure ASP File Upload 2.2.0
Dim GP_uploadAction,UploadQueryString
PureUploadSetup
If (CStr(Request.QueryString("GP_upload") <> "" Then
Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout,pau_progressBar,pau_progressWidth,pau_progressHeight
pau_thePath = """attachments"""
pau_Extensions = ""
pau_Form = "form1"
pau_Redirect = ""
pau_storeType = "file"
pau_sizeLimit = ""
pau_nameConflict = "over"
pau_requireUpload = "false"
pau_minWidth = ""
pau_minHeight = ""
pau_maxWidth = ""
pau_maxHeight = ""
pau_saveWidth = ""
pau_saveHeight = ""
pau_timeout = "600"
pau_progressBar = "YellowFlashProgress.htm"
pau_progressWidth = "300"
pau_progressHeight = "100"
Dim RequestBin, UploadRequest
CheckPureUploadVersion 2.20
ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout
end if
%>
<%
' *** Edit Operations: (Modified for File Upload) declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")
If (UploadQueryString <> "" Then
MM_editAction = MM_editAction & "?" & UploadQueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: (Modified for File Upload) set variables
If (CStr(UploadFormRequest("MM_insert") = "form1" Then
MM_editConnection = MM_strousequote_STRING
MM_editTable = "quotes"
MM_editRedirectUrl = ""
MM_fieldsStr = "first|value|last|value|position|value|company|value|address|value|city|value|state|value|zip|value|country|value|email|value|phone|value|fax|value|how|value|jobdesc|value|drawing_available|value|availablehow|value|file|value|length|value|lengthselect|value|width|value|widthselect|value|height|value|heightmenu|value|tolerance|value|cores|value|coreid|value|odlimitations|value|suppliedin|value|liner|value|liner1|value|liner2|value|liner_spec|value|quantities|value|monthlyest|value|annualreq|value|onetime|value|onetimemenu|value|comments|value|send_samples|value|salescall|value"
MM_columnsStr = "quotefirst|',none,''|quoteast|',none,''|quoteposition|',none,''|company|',none,''|address|',none,''|city|',none,''|state|',none,''|zip|',none,''|country|',none,''|email|',none,''|phone|',none,''|fax|',none,''|quotehow|',none,''|jobdesc|',none,''|drawingavailable|',none,''|availablehow|',none,''|quotefile|',none,''|quotelength|',none,''|lengthselect|',none,''|quotewidth|',none,''|widthselect|',none,''|quoteheight|',none,''|heightmenu|',none,''|tolerance|',none,''|quotecores|',none,''|quotecoreid|',none,''|odlimitations|',none,''|suppliedin|',none,''|quoteliner|',none,''|liner1|',none,''|liner2|',none,''|linerspec|',none,''|quantities|',none,''|monthlyest|',none,''|annualreq|',none,''|quoteonetime|',none,''|onetimemenu|',none,''|comments|',none,''|sendsamples|',none,''|salescall|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(UploadFormRequest(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And UploadQueryString <> "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And UploadQueryString <> "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & UploadQueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & UploadQueryString
End If
End If
End If
%>
<%
' *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
If (CStr(UploadFormRequest("MM_insert") <> "" Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),","
MM_delim = MM_typeArray(0)
If (MM_delim = "none" Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none" Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none" Then MM_emptyVal = ""
If (MM_formVal = "" Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "" Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'" Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''" & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & " values (" & MM_dbValues & ""
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_strousequote_STRING
Recordset1.Source = "SELECT * FROM quotes"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
' *** Mail Uploaded Files 1.7.0
If (CStr(Request.QueryString("GP_upload") <> "" Then
Dim MUF_path, MUF_FromName, MUF_FromEmail, MUF_ToName, MUF_ToEmail, MUF_Bcc, MUF_Subject, MUF_Body, MUF_SendHtml, MUF_checkErrors, MUF_deleteFiles, MUF_RedirectURL, MUF_SmtpServer, MUF_MailerType
MUF_path = "attachments"
MUF_FromName = "Web Site"
MUF_FromEmail = Recordset1.Fields.Item("email".Value
MUF_ToName = "Brian Holz"
MUF_ToEmail = " "
MUF_Bcc = ""
MUF_Subject = "Quote Request from Strouse.com"
MUF_Body = "Quote request"
MUF_SendHtml = false
MUF_checkErrors = true
MUF_deleteFiles = false
MUF_RedirectURL = "/quote/thanks2.asp"
MUF_SmtpServer = ""
MUF_MailerType = "CDO"
MailUploadedFiles MUF_path, MUF_FromName, MUF_FromEmail, MUF_ToName, MUF_ToEmail, MUF_Bcc, MUF_Subject, MUF_Body, MUF_SendHtml, MUF_checkErrors, MUF_deleteFiles, MUF_RedirectURL, MUF_SmtpServer, MUF_MailerType
end if
%>
Replied 11 Nov 2005 23:40:33
11 Nov 2005 23:40:33 Greg Kresslein replied:
Never mind, I figured it out.