dongronge3732 2011-02-12 02:05
浏览 105
已采纳

使用JET向数据库字段添加注释

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;");
  • 写回答

1条回答 默认 最新

  • duanpi7578 2011-02-12 16:06
    关注

    You can get at the desciption with an ADOX Catalog, which, it seems, can be used with PHP

    In VBA you could say:

    catdb.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & CurrentProject.FullName
    
    catdb.Tables("ATable").Columns("AColumn").Properties("Description") = "New descr"
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献