电脑故障

位置:IT落伍者 >> 电脑故障 >> 浏览文章

测试使用 ADOX方 便的查询表和字段


发布日期:2023/4/13
 

添加个列表框个按钮

引用微软 ADO ExtX for dll and Security

Dim cat As ADOXCatalog

Dim cnn As ADODBConnection

Dim tbl As ADOXTable

Private Sub Command_Click()

On Error Resume Next

For Each tbl In catTables

如果是sqlserver数据库则变成If Left(tblName ) <> sys

If Left(tblName ) <> MSys Then

ListAddItem tblName

End If

Next

End Sub

Private Sub Form_Load()

Set cnn = New ADODBConnection

Set cat = New ADOXCatalog

cnnOpen Provider=MicrosoftJetOLEDB;Data Source=F:\csdn_vb\database\articlemdb

cnnOpen Provider=SQLOLEDB;Persist Security Info=False;User ID=sa;Initial Catalog=northwind;Data Source=yang

Set catActiveConnection = cnn

End Sub

Private Sub Form_Unload(Cancel As Integer)

Set cat = Nothing

Set con = Nothing

End Sub

Private Sub List_Click()

Dim fld

Dim intfield As Integer

ListClear

intfield = catTables(ListList(ListListIndex))ColumnsCount

For i = To intfield

Set fld = catTables(ListList(ListListIndex))Columns(i)

ListAddItem fldName & & fldType & & fldDefinedSize

Next

End Sub

上一篇:Windows Server 2012的服务管理自动化

下一篇:如何在ADO使用SELECT语法二