Function foo()'assume connectionDim objCmd as ADODB.CommandCall EstablishConnection() 'function to connectset objCmd = new ADODB.CommandWith objCmd .ActiveConnection = objConn .CommandText = "select_template_components_by_template" 'our stored procedure .CommandType = adCmdStoredProc 'its a stored procedure .Parameters.Append .CreateParameter("ID", adBigInt, adParamInput, , Me.txtID.Text) Set objRSFill = .Execute Set objRSFill.ActiveConnection = Nothing Call ReleaseConnection 'close that connection up End With'do other code..maybe a while loop ?Set objCmd = NothingSet objRSFill = NothingEnd Function
You'll need some error handling, and your own variables to pass to the SPROC.Jonwww.web-impulse.com