Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
giovi2002
Starting Member
46 Posts |
Posted - 2005-07-22 : 18:55:09
|
Workbench : access adp / sql serverscript : AdoGoal: Pass a value from a form (1) to a stored procedure (2) and retrieve and show the recordset within the application (3)Status: 1 and 2 work with the written code, for number 3 'receive the recordset' I had to use a stupid workaround by having my SP to fill a table, after table is being filled my ado code will open a view based on this table. It would be more efficient to have my sp only to perform a parameterized query.Can you extend my ado code?I've used Dim rstKoppeltabel As ADODB.Recordset but don't know how to fill the recordset and display the results within the access adpPrivate Sub SYSLIJNNUMMER_DblClick(Cancel As Integer)On Error GoTo Err_Form_DblClickDim myado As ADODB.CommandDim rec As SingleDim StrBronrec As Variant 'parameter 1Dim StrReprec As Variant 'parameter 2Dim nmbSyslijnnummer As Variant 'parameter 3Dim stDocName As StringDim rstKoppeltabel As ADODB.Recordset 'recordset declarationSet myado = New ADODB.Commandmyado.ActiveConnection = CurrentProject.Connectionmyado.CommandType = adCmdStoredProcmyado.CommandText = "dbo.Ap_Rapportagegegevens_Bronrecords"StrBronrec = "%"StrReprec = "%"nmbSyslijnnummer = Me.SYSLIJNNUMMERmyado.Parameters.Append myado.CreateParameter("Bronrecord", adVariant, adParamInput, 12, StrBronrec)myado.Parameters.Append myado.CreateParameter("Reprecord", adVariant, adParamInput, 12, StrReprec)myado.Parameters.Append myado.CreateParameter("Syslijnnummer", adVariant, adParamInput, 12, nmbSyslijnnummer)myado.ExecuteDoCmd.OpenView "dbo.Vw_Koppeltabel_inzien", acViewPreview, acReadOnly'this part opens the view and should be replaced by fill the recordset 'and display the resultsExit_Form_DblClick:Exit SubErr_Form_DblClick:MsgBox Err.DescriptionResume Exit_Form_DblClickEnd Sub |
|
|
|
|
|
|