'获取串信息,该串信息不仅包含连接串信息还包括其他一些信息,具体参见下面的属性方法
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 --这一句调不过去,提示,无效的过程调用或参数
请高手,老手指教。谢谢!
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 --这一句调不过去,提示,无效的过程调用或参数
请高手,老手指教。谢谢!
你的代码是判断spmMgr.GetProperty(lProc, strName)是对象还是一般变量
以决定是用Set还是直接赋值既然在那里报了个错,那你最好在执行了
Set spmMgr = CreateObject("PropsMgr.ShareProps")
之后用Add Watch的方法看一下spmMgr 的内容是否为Nothing
如果是nothing的话,那么可能是PropsMgr.ShareProps没有创建成功
否则就不太清楚是什么原因了