为了得到数据对象的属性写以下过程:
Public Function getproperties(obj1 As Object) As String
Dim obj2 As Object
Dim strfh As String
For Each obj2 In obj1.Properties
strfh = strfh & obj2.Name
strfh = strfh & "="
strfh = strfh & obj2.Value
Next
getproperties = strfh
End FunctionPrivate Sub Command1_Click()
Dim objws As Workspace
For Each objws In DBEngine.Workspaces
Text1.Text = getproperties(objws)
NextEnd Sub以上过程如不要strfh = strfh & obj2.Value一句可运行,但肯定不对,如加上这句就会提示:实时错误:3251.这种对象类型不支持该操作.请问为何.
Public Function getproperties(obj1 As Object) As String
Dim obj2 As Object
Dim strfh As String
For Each obj2 In obj1.Properties
strfh = strfh & obj2.Name
strfh = strfh & "="
strfh = strfh & obj2.Value
Next
getproperties = strfh
End FunctionPrivate Sub Command1_Click()
Dim objws As Workspace
For Each objws In DBEngine.Workspaces
Text1.Text = getproperties(objws)
NextEnd Sub以上过程如不要strfh = strfh & obj2.Value一句可运行,但肯定不对,如加上这句就会提示:实时错误:3251.这种对象类型不支持该操作.请问为何.
解决方案 »
- 如何结束指定应用程序
- 可以设置为书本样式的tab控件,以前见到过。现在不记得了,有没有一个这样的控件啊
- WmiPrvSE.exe user name is SYSTEM and NETWORK SEVICE
- 如何创建一个能等待用户输入后才返回值的函数
- vb工程里要如何才能引用SQLDMO?
- 如何获取当前正在运行的应用程序列表啊?急急急。。。。
- 2个表,字段能不能直接相加减
- 谁有TTS(Text - To - Speaker)的完全(for VB 的)中文开发文档,保证给足1000分
- 想做个简单的文件夹(文件)加密解密软件,帮忙提点建议???
- 关于update的一个问题
- 子程序写在哪里?
- 我做了一个托盘,怎样实现我的程序不出现/出现在任务栏里(要在程序里设置)
Public Function getproperties(obj1 As Workspace) As String
Dim obj2 As Workspace.property
Dim strfh As String
For Each obj2 In obj1.Properties
strfh = strfh & obj2.Name
strfh = strfh & "="
strfh = strfh & obj2.Value
Next
getproperties = strfh
End FunctionPrivate Sub Command1_Click()
Dim objws As Workspace
For Each objws In DBEngine.Workspaces
Text1.Text = getproperties(objws)
NextEnd Sub
'试一下