VB6 无法通过 COM 识别 ADODB 枚举器
我支持一个遗留的 ASP 页面,它创建一个像这样的 ADODB 流对象,然后尝试使用 ADODB 枚举器设置它的类型。
Set BinaryStream = Server.CreateObject("ADODB.Stream")
BinaryStream.Type = adTypeBinary
每当我运行此命令时,我都会收到以下错误:
Variable is undefined: 'adTypeBinary'
但是,如果我明确命名我的枚举器,就像这样,它就可以工作。
BinaryStream.Type = ADODB.StreamTypeEnum.adTypeBinary
这在多个服务器实例上运行,理论上这些实例在配置和文件等方面都是同步的。这适用于除一台服务器之外的所有服务器,我不确定我们做了什么才能开始发生这种情况。我可以确认我们使用的至少一个其他库也发生了这种情况。这是怎么回事?谢谢!
I am supporting a legacy ASP page which creates an ADODB stream object like this, then attempts to set it's type with an ADODB enumerator.
Set BinaryStream = Server.CreateObject("ADODB.Stream")
BinaryStream.Type = adTypeBinary
Whenever I run this I get the following error:
Variable is undefined: 'adTypeBinary'
However, if I explicitly name my enumerator, like this, it works
BinaryStream.Type = ADODB.StreamTypeEnum.adTypeBinary
This is running on several instances of servers, which are theoretically all in sync in terms of configuration and files and such. This works on all the servers except one, and I'm not sure what we did to have this start happening. I can confirm this is happening to at least one other library we use. What is going on here? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,在定义这些值的外部包含之外,您可以使用此类非限定成员的唯一方法是在 global.asa 中定义 typelib 引用:
AFAIK outside of an external include that defines those values, the only way that you can use unqualified members like that is to define a typelib reference in your global.asa: