G
Guest
Hello I am trying to create and populate a recordset using ADO. Here is my
code:
Dim dbcurr As ADODB.Connection
Dim rstCurr As ADODB.Recordset
Set dbcurr = CurrentProject.Connection
Set rstCurr = New ADODB.Recordset
With rstCurr
..Fields.Append "From", adVariant
..Fields.Append "Date Sent", adDate
..Fields.Append "Subject", adVariant
..Fields.Append "Attachment_number", adInteger
..Fields.Append "Attachment_name", adVariant
End With
rstCurr.Open
rstCurr.AddNew
rstCurr.Fields("From") = "from"
rstCurr.Fields("Date Sent") = "sent"
'rstCurr.Fields("Subject") = "subject"
rstCurr.Update
However, I get the following error:
Multi-step operation generated errors. Check each status value.
code:
Dim dbcurr As ADODB.Connection
Dim rstCurr As ADODB.Recordset
Set dbcurr = CurrentProject.Connection
Set rstCurr = New ADODB.Recordset
With rstCurr
..Fields.Append "From", adVariant
..Fields.Append "Date Sent", adDate
..Fields.Append "Subject", adVariant
..Fields.Append "Attachment_number", adInteger
..Fields.Append "Attachment_name", adVariant
End With
rstCurr.Open
rstCurr.AddNew
rstCurr.Fields("From") = "from"
rstCurr.Fields("Date Sent") = "sent"
'rstCurr.Fields("Subject") = "subject"
rstCurr.Update
However, I get the following error:
Multi-step operation generated errors. Check each status value.