访问:运行时错误“2176” - 该属性的设置太长,但不是

发布于 2024-12-09 15:37:47 字数 874 浏览 0 评论 0原文

我不是一位经验丰富的 VBA 程序员,并且我不喜欢使用 Access。我被要求修复 MS Access 2010 VB 应用程序中的一些错误。

我有以下代码行引发运行时错误“2176” - 此属性的设置太长。

grdDocs.RowSourceType = "SELECT tblLicenceDocuments.lDocumentId, " & _
                                "tblLicenceDocuments.sTitle as Title, " & _
                                """"" as Type, " & _
                                """"" as Method, " & _
                                "tblLicenceDocuments.sAvailabilityDetails as Availability, " & _
                                """"" as Format " & _
                        "FROM tblLicenceDocuments " & _
                        "WHERE tblLicenceDocuments.lLicenceId =  1187 " & _
                        "ORDER BY tblLicenceDocuments.sTitle"

有问题的sql长度只有279个字符,所以长度不是问题(我可能是错的)。我已经运行了sql并且它是有效的。我在网上搜索过,没有找到好的线索。

任何建议将不胜感激。

I'm not an experienced vba programmer and working with access is not my cup of tea. I've been asked to fix some errors in an MS Access 2010 VB application.

I have the following line of code which throws run-time error '2176' - The setting for this property is too long.

grdDocs.RowSourceType = "SELECT tblLicenceDocuments.lDocumentId, " & _
                                "tblLicenceDocuments.sTitle as Title, " & _
                                """"" as Type, " & _
                                """"" as Method, " & _
                                "tblLicenceDocuments.sAvailabilityDetails as Availability, " & _
                                """"" as Format " & _
                        "FROM tblLicenceDocuments " & _
                        "WHERE tblLicenceDocuments.lLicenceId =  1187 " & _
                        "ORDER BY tblLicenceDocuments.sTitle"

The sql in question is only 279 characters in length, so the length is not a problem (I could be wrong). I have run the sql and it is valid. I have searched the web with no good leads.

Any suggestions will be appreciated.

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

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

发布评论

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

评论(1

风吹雪碎 2024-12-16 15:37:47

我的意思是设置 .RowSource,而不是 .RowSourceType;正如蒂姆·威廉姆斯尽职尽责地指出的那样。

I meant to set .RowSource, not .RowSourceType; As Tim Williams so dutifully pointed out.

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