VBA二次开发教程 第359页
“' 查找数据表中是否已经包含指定的实体”
Private Sub FindObject(ByVal strDwgName As String, ByVal entHandle As String, ByVal strTable As String)
mdlPubVariable.addMode = False
Dim rs As New ADODB.Recordset
rs.Open "SELECT EntHandle FROM " & strTable & " WHERE DwgName='" & strDwgName & "' AND EntHandle='" & entHandle & "';", _
adoCon, adOpenDynamic, adLockOptimistic
Debug.Print entHandle, strTable, strDwgName
实体编号:10E 表名:School 文件名 F:\..\Demo.dwg
Debug.Print adoCon
Degug.print输出结果是 Microsoft.Jet.OLEDB.4.0assword="";User ID=Admin;Data Source=F:\..\Attribute.mdb;Mode=Share Deny None;Extended Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False
Provider=Microsoft.Jet.OLEDB.4.0; 是否为调用Access 2000的引擎?
Password="";密码
User ID=Admin; 用户标识
Data Source=F:\..\Attribute.mdb;数据文件
Mode=Share Deny None; 模式共享
Extended Properties="";Jet OLEDB:System database="";扩展特征
Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";引擎???
Jet OLEDB:Engine Type=5; 引擎???
Jet OLEDB:Database Locking Mode=1; 引擎???
Jet OLEDB:Global Partial Bulk Ops=2; 引擎???
Jet OLEDB:Global Bulk Transactions=1; 引擎???
Jet OLEDB:New Database Password=""; 引擎???
Jet OLEDB:Create System Database=False; 引擎???
Jet OLEDB:Encrypt Database=False; 引擎???
Jet OLEDB:Don't Copy Locale on Compact=False; 引擎???
Jet OLEDB:Compact Without Replica Repair=False; 引擎???
Jet OLEDB:SFP=False 引擎???
Debug.Print adOpenDynamic
2
Debug.Print adLockOptimistic
3
Debug.Print "SELECT EntHandle FROM " & strTable & " WHERE DwgName='" & strDwgName & "' AND EntHandle='" & entHandle & "';"
Degug.print 输出结果是SELECT EntHandle FROM School WHERE DwgName='F:\.. \Demo.dwg' AND EntHandle='10E';
If rs.RecordCount <= 0 Then
mdlPubVariable.addMode = True
查找整个工程也没有找到 mdlPubVariable的定义
End If
rs.Close
关闭数据库
End Sub |