Mark Drelinger
asked on
how to reference a record set field within CDO syntax
I'm trying to attach a file to an email via vbscript and CDO.
The error is "Wrong number of arguments or invalid property assignment: 'objCDO.AttachFile'"
objCDO.AttachFile (rsEQUIPInvoices.Fields.It em("Invoic eFileLocat ion").Valu e)
value from recordset is exactly as:
"D:\inetpub\Media\EQUIP_In voices\201 9\12\13\I_ I_229406.p df"
I think its the way I'm referencing the field, but I can't remember the proper syntax.
Please advise.
Mark
Set objCDO = Server.CreateObject("Cdont s.NewMail" )
objCDO.BodyFormat =0 ' 0 is a plain text, 0 "zero" is a HTML
objCDO.MailFormat = 0 ' 1 is a plain text, 0 "zero" is mime format
objCDO.From = Request("varFrom")
objCDO.To = Request("varTo")
objCDO.Subject = "Invoices from Schmidt Equipment"
objCDO.Body = "Invoices from Schmidt Equipment"
While ((Repeat1__numRows <> 0) AND (NOT rsEQUIPInvoices.EOF))
objCDO.AttachFile=(rsEQUIP Invoices.F ields.Item ("InvoiceF ileLocatio n").Value)
Repeat1__index=Repeat1__in dex+1
Repeat1__numRows=Repeat1__ numRows-1
rsEQUIPInvoices.MoveNext()
Wend
objCDO.Send
Set objCDO = Nothing
The error is "Wrong number of arguments or invalid property assignment: 'objCDO.AttachFile'"
objCDO.AttachFile (rsEQUIPInvoices.Fields.It
value from recordset is exactly as:
"D:\inetpub\Media\EQUIP_In
I think its the way I'm referencing the field, but I can't remember the proper syntax.
Please advise.
Mark
Set objCDO = Server.CreateObject("Cdont
objCDO.BodyFormat =0 ' 0 is a plain text, 0 "zero" is a HTML
objCDO.MailFormat = 0 ' 1 is a plain text, 0 "zero" is mime format
objCDO.From = Request("varFrom")
objCDO.To = Request("varTo")
objCDO.Subject = "Invoices from Schmidt Equipment"
objCDO.Body = "Invoices from Schmidt Equipment"
While ((Repeat1__numRows <> 0) AND (NOT rsEQUIPInvoices.EOF))
objCDO.AttachFile=(rsEQUIP
Repeat1__index=Repeat1__in
Repeat1__numRows=Repeat1__
rsEQUIPInvoices.MoveNext()
Wend
objCDO.Send
Set objCDO = Nothing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER