Closed "open" Recordset in Access adp

D

Darino-sama

The following results in a Recordset that is closed! I've replaced
the Server and Db name in the string below...

Dim Conn As New Connection
Dim strConnString As String
Dim cmd5Yr As New Command

strConnString = "Provider=sqloledb;" & _
"Data Source=SQL Server Here;" & _
"Initial Catalog=Db Name Here;" & _
"Integrated Security=SSPI"

Conn.Open strConnString

With cmd5Yr
.ActiveConnection = Conn
.CommandText = "spReport5YrData_Sel"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@ClientCode", adVarChar,
adParamInput, 3, ClientCode)
.Parameters.Append .CreateParameter("@ReportDateEnd", adDate,
adParamInput, 25, EnteredDate)
End With

Set FiveyrRs = cmd5Yr.Execute

This is an .adp file on a network with adequate permissions.

See anything wrong with this picture?

Thanks, D-
 
V

Vadim Rapp

Ds> See anything wrong with this picture?

probably ON RESUME RESUME NEXT somewhere above it.

Vadim
 
G

Guy Horton

Darino,

Is this the complete subroutine? Apologies in advance if I have
misunderstood the thread of your question but does this help:

1) Declare the recordset FiveyrRS:

Dim FiveyrRs As ADODB.Recordset

2) Set the declared stored procedure parameters to some value: (form based
call assumed)

..Parameters("@ClientCode") = Me!txtClientCode
..Parameters("@ReportDateEnd") = Me!txtDateEnd

Hope this helps

Regards
Guy
 

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