'获取串信息,该串信息不仅包含连接串信息还包括其他一些信息,具体参见下面的属性方法
Private Function GetConnectionProperty(strName As String, Optional ByVal bRaiseError As Boolean = True) As VariantDim spmMgr As Object
Dim lProc As Long
lProc = GetCurrentProcessId()
Set spmMgr = CreateObject("PropsMgr.ShareProps")
If IsObject(spmMgr.GetProperty(lProc, strName)) Then  '这一句调不过去,提示,无效的过程调用或参数 
Set GetConnectionProperty = spmMgr.GetProperty(lProc, strName)
Else
GetConnectionProperty = spmMgr.GetProperty(lProc, strName)
End If
End Function
'-----------------------------------------------------------------------------------------------
If IsObject(spmMgr.GetProperty(lProc, strName)) Then --这一句调不过去,提示,无效的过程调用或参数 
请高手,老手指教。谢谢!

解决方案 »

  1.   

    顶1楼,IsObject这个函数是判断变量是不是对象
      

  2.   

    单从代码来看应该是没有问题的
    你的代码是判断spmMgr.GetProperty(lProc, strName)是对象还是一般变量
    以决定是用Set还是直接赋值既然在那里报了个错,那你最好在执行了
    Set spmMgr = CreateObject("PropsMgr.ShareProps") 
    之后用Add Watch的方法看一下spmMgr 的内容是否为Nothing
    如果是nothing的话,那么可能是PropsMgr.ShareProps没有创建成功
    否则就不太清楚是什么原因了