BDE 对 .sch 模式文件使用什么标准?

发布于 2024-07-18 10:19:12 字数 2045 浏览 8 评论 0原文

我想知道 - BDE 使用的 .sch 模式文件格式是否有一个标准(如 RFC)?

此处此处。 它似乎基于这种 Microsoft 格式,但并不完全相同。

示例 1 - 不同格式文件

CUSTOMER.SCH:

[CUSTOMER]
Filetype=VARYING
Delimiter="
Separator=,
CharSet=ascii
Field1=Customer No,Float,20,04,00
Field2=Name,Char,30,00,20
Field3=Phone,Char,15,00,145
Field4=First Contact,Date,11,00,160

CUSTOMER.TXT:

1221.0000,"Kauai Dive Shoppe","808-555-0269",04/03/1994
1231.0000,"Unisco","809-555-3915",02/28/1994
1351.0000,"Sight Diver","357-6-876708",04/12/1994
1354.0000,"Cayman Divers World Unlimited","809-555-8576",04/17/1994
1356.0000,"Tom Sawyer Diving Centre","809-555-7281",04/20/1994

示例 2 - 固定格式文件

CUSTOMER.SCH:

[CUSTOMER]
Filetype=Fixed
CharSet=ascii
Field1=Customer No,Float,20,04,00
Field2=Name,Char,30,00,20
Field3=Phone,Char,15,00,145
Field4=First Contact,Date,08,00,160

CUSTOMER.TXT:

           1221.0000Kauai Dive Shoppe             808-555-0269   04/03/94
           1231.0000Unisco                        809-555-3915   02/28/94
           1351.0000Sight Diver                   357-6-876708   04/12/94
           1354.0000Cayman Divers World Unlimited 809-555-8576   04/17/94
           1356.0000Tom Sawyer Diving Centre      809-555-7281   04/20/94

我对“文件类型”、“分隔符”、“分隔符”的可能参数值特别感兴趣'和'字符集'。 我使用各种术语(“RFC”、“架构”、“文件类型”、“标准”等)在互联网上进行了搜索,但结果却是空白......

我想具体了解的事情:

  • 什么编码可以用于 .sch 文件本身? (这与正确解释字段名和其他可配置字符相关。)
  • 我应该如何指定不可打印的分隔符和分隔符字符,例如 Ansi 控制字符,如“单位分隔符”($1F),甚至是简单的“制表符” (09 美元)? (考虑到格式的历史,我认为我应该使用插入符号,但只是想确定一下。)
  • 如何指定不使用分隔符? 我应该指定一个空值,还是完全保留设置?

TIA

PS:注意,我没有使用 BDE 本身 - 它只是我必须正确生成和读取的这些模式文件。

I was wondering - is there a standard (like a RFC) for the .sch schema file format the BDE uses?

The format is described here and here. It seems based on this Microsoft format, but it's not quite the same.

Example 1 - VARYING format file

CUSTOMER.SCH:

[CUSTOMER]
Filetype=VARYING
Delimiter="
Separator=,
CharSet=ascii
Field1=Customer No,Float,20,04,00
Field2=Name,Char,30,00,20
Field3=Phone,Char,15,00,145
Field4=First Contact,Date,11,00,160

CUSTOMER.TXT:

1221.0000,"Kauai Dive Shoppe","808-555-0269",04/03/1994
1231.0000,"Unisco","809-555-3915",02/28/1994
1351.0000,"Sight Diver","357-6-876708",04/12/1994
1354.0000,"Cayman Divers World Unlimited","809-555-8576",04/17/1994
1356.0000,"Tom Sawyer Diving Centre","809-555-7281",04/20/1994

Example 2 - FIXED format file

CUSTOMER.SCH:

[CUSTOMER]
Filetype=Fixed
CharSet=ascii
Field1=Customer No,Float,20,04,00
Field2=Name,Char,30,00,20
Field3=Phone,Char,15,00,145
Field4=First Contact,Date,08,00,160

CUSTOMER.TXT:

           1221.0000Kauai Dive Shoppe             808-555-0269   04/03/94
           1231.0000Unisco                        809-555-3915   02/28/94
           1351.0000Sight Diver                   357-6-876708   04/12/94
           1354.0000Cayman Divers World Unlimited 809-555-8576   04/17/94
           1356.0000Tom Sawyer Diving Centre      809-555-7281   04/20/94

I'm especially interested in the possible argument-values for 'Filetype', 'Delimiter', 'Separator' and 'CharSet'.
I've searched the internet using various terms ('RFC', 'schema', 'filetype', 'standard', etc), but came up blank...

Things I would like to know specifically :

  • What encoding(s) can be used for the .sch file itself? (This is relevant for correctly interpreting the fieldnames and other configurable characters.)
  • How should I specify non-printable Separator and Delimiter characters, for example an Ansi control-character like "Unit Separator" ($1F) or even a simple "Tab" ($09)? (Given the age of the format I think I should use Caret notation, but it'd just like to be sure.)
  • How can I specify to not-use a Delimiter? Should I specifiy an empty value, or leave the setting out altogether?

TIA

PS: Note, I'm not using the BDE itself - it's just these schema files that I have to generate and read correctly.

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

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

发布评论

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

评论(2

似狗非友 2024-07-25 10:19:13

在硬盘驱动器中搜索随 Borland Delphi 一起安装的名为 bde32.hlp 的文件。 它是一个 Windows 帮助文件,其中包含 BDE API 的文档。 它还包含标题为“将外部架构绑定到文本表”的主题,其中描述了 *.sch 文件的格式。

在“语言驱动程序”标题下,同一帮助文件还包含可以为 *.sch 文件中的 CharSet 条目指定的“短名称”列表。

因此,例如,如果您想使用西欧语言的 Windows 字符集 (Windows-1252),您将需要法语重音字符或德语变音符号,则 CharSet 使用的值是ANSIINTL 像这样:

[CUSTOMER]
Filetype=VARYING
Delimiter="
Separator=,
CharSet=ANSIINTL

可以使用什么编码
.sch 文件本身? (这是相关的
为了正确解释
字段名称和其他可配置的
字符。)

只是简单的 ASCII。 除了字符代码为 0-127 的旧 ASCII 字符外,没有任何场景要求或允许您使用任何字符(除了用于分隔不同行的换行符),只有可打印字符才有意义。

例如,表名或列名中不允许使用其他字符(元音变音、重音字符等)。

我应该如何指定不可打印
分隔符和定界符,
例如 Ansi 控制字符
比如“Unit Separator”($1F),甚至是
简单的“Tab”($09)? (考虑到年龄
我认为我应该使用插入符的格式
符号,但它只是想成为
当然。)

不可能。 只有“可见”字符才能用作定界符和分隔符。 要使用选项卡,只需使用空分配:

[CUSTOMER]
Filetype=VARYING
Delimiter="
Separator=
CharSet=ANSIINTL

我如何指定不使用
分隔符? 我应该指定一个空的
值,或保留设置
总共?

在“固定”格式中,不使用分隔符和定界符。 在“Varying”格式中,分隔符始终用于字符串/字符类型的列,而分隔符从不用于其他列类型。 要不使用分隔符,只需在架构中使用空赋值即可:

[CUSTOMER]
Filetype=VARYING
Delimiter=
Separator=,
CharSet=ANSIINTL

Search your hard drive for a file called bde32.hlp that is installed with Borland Delphi. It is a Windows Help file that contains a documentation of the BDE API. It also contains a topic titled "Binding external schema to text tables" which describes the format of the *.sch files.

Under the title "Language drivers", the same help file also contains a list of "short names" that can be specified for the CharSet entry in the *.sch file.

So, for example, if you want to use the Windows character set for west european languages (Windows-1252), that you will need for French accented characters or German umlauts, the value to use for CharSet is ANSIINTL like that:

[CUSTOMER]
Filetype=VARYING
Delimiter="
Separator=,
CharSet=ANSIINTL

What encoding(s) can be used for the
.sch file itself? (This is relevant
for correctly interpreting the
fieldnames and other configurable
characters.)

Just plain ASCII. There is no scenario that would require or allow you to use anything but good old ASCII characters with character codes from 0-127 and of those (except for line breaks to separate the different lines) only printable characters are meaningful.

For example, no other characters (umlauts, accented chars, etc) are allowed in the table name or column names.

How should I specify non-printable
Separator and Delimiter characters,
for example an Ansi control-character
like "Unit Separator" ($1F) or even a
simple "Tab" ($09)? (Given the age of
the format I think I should use Caret
notation, but it'd just like to be
sure.)

Not possible. Only "visible" characters can be used as delimiter and separator. To use a tab, just use an empty assignment:

[CUSTOMER]
Filetype=VARYING
Delimiter="
Separator=
CharSet=ANSIINTL

How can I specify to not-use a
Delimiter? Should I specifiy an empty
value, or leave the setting out
altogether?

In "Fixed" format, no separators and no delimiters are used. In "Varying" format, a delimiter is always used for columns with string/character type and a delimiter is never used for other column types. To not use a delimiter, just use an empty assignment in the schema:

[CUSTOMER]
Filetype=VARYING
Delimiter=
Separator=,
CharSet=ANSIINTL
清欢 2024-07-25 10:19:13

很难得到你的问题的明确答案。 BDE 已被弃用多年,大多数最初的开发人员已经转向其他工作。

如果我没记错的话,当 BDE 第一次被称为 ODAPI 以及后来的 IDAPI(独立数据库API,由Borland、Novell、IBM 和WordPerfect 在90 年代初共同开发)。

与此同时,Borland 更名为 Inprise,将重点转移到企业市场,再次成为 Borland,将开发人员工具和数据库部门分离到 CodeGear 中,并将 CodeGear 出售给 Embarcadero(最终再次以开发人员为中心)。

我会尝试想出一些像样的东西,并稍后扩展这个答案,或者下周在 DelphiLive! 询问。

等等 :-)

编辑 1:更多信息

idasci32.dll 中支持 ASCII

这些字段的值:

文件类型:

  • 固定
  • 分隔符

分隔符:未知

分隔符:未知

字符集:

  • ascii

It'll be really hard to get a definitive answer to your question. BDE has been deprecated for years now, and most of the original developers have moved on to other jobs.

If memory serves me correctly, the text (later ASCII) support of the BDE was already in there when it was first called ODAPI and later IDAPI (Independent Database API, a codevelopment of Borland, Novell, IBM and WordPerfect in the early 90's).

In the mean time, Borland became Inprise, moved its focus to the enterprise market, became Borland again, separated the developer tools and databases group into CodeGear and sold CodeGear to Embarcadero (which finally was developer centric again).

I will try to come up with something decent and extend this answer later on, or ask around at DelphiLive! next week.

Hang on :-)

Edit 1: some more information

Support for ASCII is in idasci32.dll

Value values for these fields:

Filetype:

  • Fixed
  • Delimited

Delimiter: unknown

Separator: unknown

CharSet:

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