Reputation: 1802
I'm new to Delphi7.
When I try to use the editor's "Add all fields" feature on a TClientDataSet object a messagebox (the classic error message box) appear with the message "No value for parameter '(the name of the parameter)'".
I can't add fields using the "all fields" feature anymore.
How can I find the source of the "No value for parameter" error?
Upvotes: 5
Views: 2668
Reputation: 1802
I managed by myself. The TClientDataSet
object had a parameter with DataType
and ParamType
properties both set to Unknown
. Setting the parameter with correct properties solved the problem, I was able to "add all fields" again. Thanks for the answers.
Upvotes: 2
Reputation: 642
I don't think any data is necessary to do what you want - and the first answer provided does not seem to include data, even though that is the original statement. You should be able to add all fields so long as you have a connection to a table, query, stored procedure or something similar.
Your question says there is no value for a parameter, and shows which parameter - although you don't say. But it is probably the parameter for a query or such. That query is failing because you are not providing a parameter, therefore you don't get any results. Of course this includes no fields.
Check the parameter in the error message.
Upvotes: 0
Reputation: 76724
The problem is (most likely) that the ClientDataSet is not filled with any data.
Lacking data, no fields can be listed.
Do the following:
connection
property to connection1.tablename
property to a valid table; set active
to true. datasetprovider
on the form. [datasetprovider1] dataset
to table1. providername
of cds1 to datasetprovider1.cds1.Active
to trueNow you can select fields, because now the cds holds actual data.
Upvotes: 3