“参数无值”错误信息

发布于 2024-12-17 10:06:40 字数 156 浏览 7 评论 0原文

我是Delphi7的新手。

当我尝试在 TClientDataSet 对象上使用编辑器的“添加所有字段”功能时,会出现一个消息框(经典错误消息框),其中显示消息“参数‘(参数名称)’没有值”。
我无法再使用“所有字段”功能添加字段。
如何找到“参数无值”错误的根源?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

荒路情人 2024-12-24 10:06:40

问题(最有可能)是 ClientDataSet 未填充任何数据。
缺少数据,无法列出任何字段。

执行以下操作:

  1. 在表单上建立连接。 [connection1]
  2. 将其连接到数据库,填写登录名、密码、数据库等。
  3. 使连接处于活动状态。 (只有正确填写所有连接参数才可能)。
  4. 在表格上放一个表格。 [table1]
  5. 将其connection 属性设置为connection1。
  6. tablename属性设置为有效的表;将 active 设置为 true。
  7. 在表单上放置一个datasetprovider。 [datasetprovider1]
  8. 数据集设置为table1。
  9. 将客户数据集放在您的表单 [cds1] 上。
  10. 将 cds1 的 providername 设置为 datasetprovider1。
  11. 将 cds1.Active 设置为 true

现在您可以选择字段,因为现在 cds 保存了实际数据。

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.

往事随风而去 2024-12-24 10:06:40

我自己管理的。 TClientDataSet 对象有一个参数,其 DataTypeParamType 属性均设置为 Unknown。使用正确的属性设置参数解决了问题,我能够再次“添加所有字段”。感谢您的回答。

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.

┾廆蒐ゝ 2024-12-24 10:06:40

我认为不需要任何数据即可完成您想要的操作 - 并且提供的第一个答案似乎不包含数据,即使这是原始声明。只要您有到表、查询、存储过程或类似内容的连接,您就应该能够添加所有字段。

你的问题说参数没有值,并显示哪个参数 - 尽管你没有说。但它可能是查询等的参数。该查询失败,因为您没有提供参数,因此您没有得到任何结果。当然,这不包括任何字段。

检查错误信息中的参数。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文