Judging a few tables in an Access database in the program

xiaoxiao2021-03-06  43

Private sub flow_load ()

'Menu "Project" -> "Quote" -> "Microsoft ActiveX Data Objects 2.7 Library"

'Microsoft ADO Ext.2.7 for DDL Ado Security

DIM Cat as adox.catalog

Dim adocon as adodb.connection

Set adocon = new adoDb.connection

Adocon.open "provider = microsoft.jet.oledb.4.0; data source =" & app.path "/newdata.mdb;" & "= share deny read | Share deny Write; persist security info = false; Jet OLEDB : Database Password = "

SET CAT = New Adox.catalog

SET CAT.ActiveConnection = adocon

For i = 0 to Cat.Tables.count - 1 'Cat.Tables.count is the number of tables

Debug.print Cat.Tables (i) .Name 'Remove the table name

If cat.tables (i) .name = "myTable" then

For J = 0 to Cat.Tables (i) .COLUMns.COUNT - 1

Debug.print Cat.Tables (i) .COLUMNS (J) 'Remove the column name

Debug.print Cat.Tables (i) .Columns (j) Remove Data Type

For Each P in Cat.Tables (i) .COLUMNS (J) .properties

Debug.print p.Type & P.Name & p.attributes' Remove the properties of the column

NEXT

NEXT J

END IF

Next i

Cat.Tables.Item ("MyTable"). Column ("ll"). Properties ("Jet OLEDB: Allow Zero Length"). Value = true 'Set zero length is correct

Set cat = Nothing

Adocon.close

Set adocon = Nothing

End Sub

转载请注明原文地址:https://www.9cbs.com/read-51466.html

New Post(0)