使用 JET 添加注释到数据库字段
我正在编写一个脚本,使用 PHP 中的 Jet 引擎在线管理小型 Access 数据库。我遇到困难的一件事是向字段添加评论。直接使用 Access 非常容易,但我不知道如何通过 SQL 语句或类似的语句以编程方式完成此操作。有什么想法吗?谢谢!
编辑
我通常使用 MySQL,但 Access 有时会为较小的数据库提供一些好处。大多数情况下,我可以下载它们并将其通过电子邮件发送给人们,以用于他们需要的任何目的。
我将时间戳存储为 long int
而不是内置类型之一,因为这样在 PHP 中使用起来更容易,并且运行查询也更容易。我想在这些时间戳字段旁边添加一个简单的注释,简单地说类似 Unix Timestamp 之类的内容,这样脚本和用户都知道这是一个时间戳,而不仅仅是一个数字。我已经知道如何阅读注释,但似乎不知道在添加新字段时如何编写注释。
我使用 ADODB 和 Jet 与数据库交互,如下所示:
$conn = new COM('ADODB.Connection');
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={$db};Mode=ReadWrite;");
I am working on a script to manage a small Access database online using the Jet engine in PHP. One thing I am having trouble doing is adding a comment to a field. This is quite easy using Access directly, but I can't figure out to do it programatically through an SQL statement or something similar. Any ideas? Thanks!
EDIT
I generally use MySQL, but Access provides a few benefits from time to time for smaller databases. Mostly, I can download and email them to people to use for whatever purpose they require.
I store timestamps as a long int
rather than one of the built in types because it is easier to work with in PHP that way, and a lot easier to run a query against. I want to add a simple comment next to these timestamp fields that simply says something like Unix Timestamp
so both the script and user know this as a timestamp rather than simply a number. I already know how to read comments, but can't seem to figure out how to write them when adding a new field.
I am using ADODB and Jet to interact with the database like so:
$conn = new COM('ADODB.Connection');
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={$db};Mode=ReadWrite;");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 ADOX 目录获取说明, 这似乎可以与 PHP 一起使用
在 VBA 中你可以说:
You can get at the desciption with an ADOX Catalog, which, it seems, can be used with PHP
In VBA you could say: