使用 Firebird 让 DBX 识别布尔值

发布于 2024-08-16 08:59:55 字数 506 浏览 6 评论 0原文

Firebird 常见问题解答解释了如何创建 BOOLEAN 域。也许最有趣的部分是在最后,它说:

如果您使用像这样的连接库 .Net下的OleDB,可以覆盖 OleDB提供者的GetSchema方法,所以 从查询中获得的 DataTables 拥有原生 .Net 布尔值。

DB Express 有什么办法可以做到这一点吗?我正在使用 http://sites.google.com/site/dbxfirebird/< 中的 DBX 驱动程序/a>,如果能够在我的数据集中取回 TBooleanField 实例而不是 TSmallintField ,那就太好了。

The Firebird FAQ explains how to create a BOOLEAN domain. Probably the most interesting part is at the end, where it says:

If you use a connectivity library like
OleDB under .Net, you can override the
OleDB provider's GetSchema method, so
the DataTables you get from queries
have native .Net booleans.

Is there any way to do that with DB Express? I'm using the DBX driver from http://sites.google.com/site/dbxfirebird/, and it would sure be nice to be able to get back TBooleanField instances in my datasets instead of TSmallintField.

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

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

发布评论

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

评论(1

回首观望 2024-08-23 08:59:55

它由每个 TDataSet 后代可以覆盖的这两个方法处理:

function TDataSet.GetFieldClass(FieldType: TFieldType): TFieldClass;
begin
  Result := DefaultFieldClasses[FieldType];
end;

function TDataSet.GetFieldClass(FieldDef: TFieldDef): TFieldClass;
begin
  Result := GetFieldClass(FieldDef.DataType);
end;

--jeroen

It is handled by these two methods that each TDataSet descendant can override:

function TDataSet.GetFieldClass(FieldType: TFieldType): TFieldClass;
begin
  Result := DefaultFieldClasses[FieldType];
end;

function TDataSet.GetFieldClass(FieldDef: TFieldDef): TFieldClass;
begin
  Result := GetFieldClass(FieldDef.DataType);
end;

--jeroen

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