How do you comment an MS-access Query?

前端 未结 9 2000
失恋的感觉
失恋的感觉 2020-12-29 20:04

How does one add a comment to an MS Access Query, to provide a description of what it does?

Once added, how can one retrieve such comments programmatically?

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-29 20:49

    NOTE: Confirmed with Access 2003, don't know about earlier versions.

    For a query in an MDB you can right-click in the query designer (anywhere in the empty space where the tables are), select Properties from the context menu, and enter text in the Description property.

    You're limited to 256 characters, but it's better than nothing.

    You can get at the description programatically with something like this:

    Dim db As Database
    Dim qry As QueryDef
    
    Set db = Application.CurrentDb
    Set qry = db.QueryDefs("myQuery")
    
    Debug.Print qry.Properties("Description")
    

提交回复
热议问题