【问题标题】:Error Type: Microsoft VBScript runtime (0x800A01A8) Object required in asp错误类型:Microsoft VBScript 运行时 (0x800A01A8) asp 中需要对象
【发布时间】:2015-05-30 16:35:40
【问题描述】:

我是新手..

并尝试使用code访问

但它显示像这样的错误。,

错误类型: Microsoft VBScript 运行时 (0x800A01A8) 所需对象: '' 在第 163 行

由于这一行而显示的错误,

<%
do while not getgroups2.eof 
    pkOrgGroups2=getgroups2("pkOrgGroups")
    ogGroup2=getgroups2("ogGroup")
    ogLogo2 =getgroups2("ogLogo")
%> 

我可以知道我的代码显示这样的原因吗?

提前致谢。

【问题讨论】:

  • 很确定这是 经典 ASP,而不是 ASP.NET。它们是两种不同的东西......
  • @Tim: 我编辑了我的帖子..

标签: vbscript asp-classic


【解决方案1】:

有两种确定的方法可以得到“需要对象”错误:

在分配非对象时尝试使用Set

>> Set x = "non-object/string"
>>
Error Number:       424
Error Description:  Object required

尝试在非对象上调用方法:

>> WScript.Echo TypeName(x)
>> If x.eof Then x = "whatever"
>>
Empty
Error Number:       424
Error Description:  Object required

或:

>> x = "nix"
>> WScript.Echo TypeName(x)
>> If x.eof Then x = "whatever"
>>
String
Error Number:       424
Error Description:  Object required

由于您发布的代码中没有Set,因此必须假设getgroups2 不是对象。使用 TypeName() 进行检查。

【讨论】:

  • @Ekkehard.Horner:我需要使用一些条件......你能帮忙吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-04-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多