Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"No value for parameter" error message

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?

like image 492
Francesco Avatar asked Nov 21 '11 17:11

Francesco


1 Answers

The problem is (most likely) that the ClientDataSet is not filled with any data.
Lacking data, no fields can be listed.

Do the following:

  1. put a connection on the form. [connection1]
  2. Connect it to a database fill in login, password, database, and whatnot.
  3. Make the connection active. (only possible if all the connection parameters are filled in correctly).
  4. put a table on the form. [table1]
  5. Set it's connection property to connection1.
  6. Set the tablename property to a valid table; set active to true.
  7. Put a datasetprovider on the form. [datasetprovider1]
  8. Set the dataset to table1.
  9. Put a clientdataset on your form [cds1].
  10. Set the providername of cds1 to datasetprovider1.
  11. Set cds1.Active to true

Now you can select fields, because now the cds holds actual data.

like image 192
Johan Avatar answered Sep 23 '22 09:09

Johan