Hi
I want to base a VB6 Data Report on an SQL Query which will retreive specific data from an Access 97 table. The context is 'Stock Control' and I have reduced the problem to the code below which will simply produce a stock list based upon stock search criteria (clearly at present all stock is retreived - no serach criteria given) using SQL literal. The error message 'Wrong Number of Arguments' appears in the 'DataEnvironment1.Pupils strSQL' line of the program when run.
'Stock' is a named command set up in the data environment which returns field data (Stock_ID, Qty_In_Stock' etc against the stock table. adCmdtable is the command type property assigned to this command.
Is my use of the Data Environment correct when attempting to populate DR fields this way. the Data report's data source is Data Environment 1?
Hope you can help. Suspect this could be a trivial issues but FAQ' s fail to clarify.
[code/]
Private Sub cmdPrint_Click()
Dim strSQL As String
strSQL = "SELECT * FROM tblStock"
DataEnvironment1.Stock strSQL
drStockSlip.Show
End Sub
[/code]
I want to base a VB6 Data Report on an SQL Query which will retreive specific data from an Access 97 table. The context is 'Stock Control' and I have reduced the problem to the code below which will simply produce a stock list based upon stock search criteria (clearly at present all stock is retreived - no serach criteria given) using SQL literal. The error message 'Wrong Number of Arguments' appears in the 'DataEnvironment1.Pupils strSQL' line of the program when run.
'Stock' is a named command set up in the data environment which returns field data (Stock_ID, Qty_In_Stock' etc against the stock table. adCmdtable is the command type property assigned to this command.
Is my use of the Data Environment correct when attempting to populate DR fields this way. the Data report's data source is Data Environment 1?
Hope you can help. Suspect this could be a trivial issues but FAQ' s fail to clarify.
[code/]
Private Sub cmdPrint_Click()
Dim strSQL As String
strSQL = "SELECT * FROM tblStock"
DataEnvironment1.Stock strSQL
drStockSlip.Show
End Sub
[/code]