m.Start = {^1997/01/01} m.End = {^1997/03/14} * Stored proc - ODBC Local lnHandle lnHandle=Sqlstringconnect('DRIVER=SQL Server;SERVER=servername;'+; 'Trusted_connection=Yes;Database=Northwind') SQLExec(lnHandle,'exec [Sales by Year] ?m.Start, ?m.End','myOrders') SQLDisconnect(lnHandle) Browse * Stored proc - ADO #Define adDBTimeStamp 135 Local oConn As ADODB.Connection, oCmd As ADODB.Command, ; oRS As ADODB.Recordset, oParameter As ADODB.Parameter oConn = Createobject('ADODB.Connection') oCmd = Createobject('ADODB.Command') oConn.ConnectionString = 'Provider=SQLOLEDB;Data Source=servername;'+; 'Integrated Security=SSPI;Initial Catalog = Northwind' oConn.Open oCmd.ActiveConnection = oConn oCmd.CommandText = "[Sales by Year]" oCmd.CommandType = 4 &&adCmdStoredProc oParameter = oCmd.CreateParameter('Beginning_Date',adDBTimeStamp,,,m.Start) oCmd.Parameters.Append(oParameter) oParameter = oCmd.CreateParameter('Ending_Date',adDBTimeStamp,,,m.End) oCmd.Parameters.Append(oParameter) oRS = oCmd.Execute *Show Showme('Stored proc result',m.oRS) oRS.Close oConn.Close Function Showme Lparameters tcCaption,toRecordset oForm = Createobject('myForm', tcCaption,toRecordset) oForm.Show Read Events Endfunc Define Class myform As Form Height = 450 Width = 750 Name = "Form1" Add Object hflex As OleControl With ; Top = 10, Left = 10, Height = 430, Width = 730, Name = "Hflex", ; OleClass = 'MSHierarchicalFlexGridLib.MSHFlexGrid' Procedure Init Lparameters tcCaption,toRecordset This.Caption = tcCaption This.hflex.Datasource = toRecordset Endproc Procedure QueryUnload Clear Events Endproc EnddefineCetin