create recordset using ADO

T

Tom

Hello I am trying to create and popluate 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 "MSPR_MSG_ID", adInteger
..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 an error saying that:

Mulit-step operation generated errors. Check each status value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top