Closed "open" Recordset in Access adp

  • Thread starter Thread starter Darino-sama
  • Start date Start date
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-
 
Ds> See anything wrong with this picture?

probably ON RESUME RESUME NEXT somewhere above it.

Vadim
 
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
 
Back
Top