Lazarus Free Pascal/Delphi-RunError 211 [英] Lazarus Free Pascal / Delphi - RunError 211

查看:110
本文介绍了Lazarus Free Pascal/Delphi-RunError 211的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Windows XP程序(Lazarus)连接到我的Ubuntu postgres服务器.

I'm trying to connect my Windows XP program (Lazarus) to my Ubuntu postgres server.

当Lazarus程序运行时,它似乎可以正常编译,但出现此错误:

When the Lazarus program runs, it seems to compile fine but I get this error:

项目...引发了异常类'RunError(211)'.

Project ... raised exception class 'RunError(211)'.

然后它终止执行(我看不到任何输出),并打开文件 customform.inc .在该文件中,它显示了过程procedure TCustomForm.DoCreate;,其中突出显示了一行:if Assigned(FOnCreate) then FOnCreate(Self);

Then it terminates execution (and I don't see any output), and opens up a file customform.inc. In that file, it shows a procedure procedure TCustomForm.DoCreate; where it highlights a line: if Assigned(FOnCreate) then FOnCreate(Self);

我相信这是系统的文件之一.

I believe this is one of the system's files.

我从没看到任何输出. 这可能是什么?谢谢!

I never get to see any output. What could this be? Thanks!

更多信息:

我将错误范围缩小到了这一行:

I've narrowed down the error to this line:

  dbQuery_Menu.SQL.Text:='Select * From "tblMenus"';

  dbQuery_Menu.Open;

执行OPEN语句时触发异常.

the exception is triggered when the OPEN statement gets executed.

顺便说一句,dbQuery_Menu被定义为TSQLQuery组件.

BTW, dbQuery_Menu is defined as a TSQLQuery component.

毫无头绪! :(

推荐答案

近5天后,我找到了答案.非常感谢所有的想法,尤其是 RRUZ RBA Guillem Vicens .还有其他相关文章都与使FIRST Lazarus程序与PostgreSQL一起使用有关.

After nearly 5 days I found the answer. Many thanks to all thos e ho have contributed with their ideas ESPECIALLY RRUZ, RBA and Guillem Vicens. there are other related posts all connected to getting the FIRST Lazarus program working with PostgreSQL.

摘要.

  1. 我在这里犯的最大错误是我使用了TSQLConnection组件.不要这样而是使用TPQConnection.

  1. The biggest mistake I made here was that I used the TSQLConnection component. Don't do this. Instead use the TPQConnection.

一切都通过代码完成.我们没有使用顶部标签中的任何可拖动组件.

Everything is done through code. We're not using any draggable components from the top tab.

至少在处理PG DB时不要依赖Lazarus文档(wiki).其中一些示例可能会令人误解.

Don't rely on the Lazarus docs (wiki) at least for working with PG DBs.. It is outdated. Some of the examples can be pretty misleading.

确保字段具有一些默认值.例如,如果布尔值字段未设置true或false(t/f),则可能会导致错误.

Make sure that fields have some default values. For example, if a Boolean field has no true or false (t/f) set, this may lead to errors.

就是这样!我希望许多postgres + Lazarus新手都能从中受益.

And that's it! I hope many postgres+Lazarus newbies will find this useful.

这篇关于Lazarus Free Pascal/Delphi-RunError 211的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆