1
votes

I am creating a application which uses Access ADP (Access Data Project). as the front-end and SQL Server as the back end. I am using ADODB for the connection. I have been doing some research as to whether to use the RecordSource property or Recordset property for forms. My goal is to create an unbound application.

I haven't been able to get a clear answer on which one to use. So far, what I have been able to do is set the recordsource to the stored procedure like this

 strSQL = "exec STOREDPROCEDURE "
 Me.Form.RecordSource = strSQL

I can also open the same SQL str as a recordset, set the forms recordset then close the recordset like this

Dim Cmd As New ADODB.Command
Dim rs As New ADODB.Recordset

   Set rs = New ADODB.Recordset

   strSQL = "exec STOREDPROCEDURE"

   rs.Open strSQL, CurrentProject.Connection

Set Me.Recordset = rs
rs.Close

Can someone explain to me what the differences are between the 2 and which is the preferred method? The way I see it, the data is getting filtered on SQL Server before being passed back to the application, so I am not seeing the difference between using Recordset or Recordsource.

1

1 Answers

1
votes

With an .adp, you will use record source, not recordset, though you may depending on what version of access you are running, need also to set the input parameters property as well.

Me.RecordSource = "EXEC schema.storedprocedue [arguments]"

will work fine for forms.

One comment I would make however is - why an .adp? MS Access 2013 & Later will not run an adp, and Access 2010 is likely to become unsupported in another couple of years.