General operation Access database, there are alter statements, and MSSQL2K basic syntax difference is not too dozen, for example, in a table to create a new column statement:
Dim sqlstr
sqlstr="alter table l_info add column info_file varchar(200)default NULL"
conn.execute(sqlstr)
The above statement creates column Info_file in L_info, for text type, length is 200, if there are no other settings, this time, the default:
Required field: No
Allow null character Fu Yi: No
This empty string can generally allow words not very satisfied, there is ADOX this space processing.
For more information please visit: Microsoft ADOX Introduction
This examples is a lot of surprising, can visit here to see all.
Here's one example: Many features can be implemented:
Sub Addhelpcolumn ()
Dim oconn, OCat, Ocolumn
' Open the Database
Set oconn = Server.CreateObject ("ADODB. Connection ")
oConn.Open mm_conn_string
' Open Table
Set OCat = Server.CreateObject ("ADOX. Catalog ")
Set ocat.activeconnection = oconn
' Create column
Set Ocolumn = Server.CreateObject ("ADOX. Column ")
With Ocolumn
Set. ParentCatalog = OCat ' must set before setting properties. Name = "Memhelp"
. Type = adLongVarWChar
. Properties ("Nullable") = True
. Properties ("Jet oledb:allow Zero Length") = True
End With
Ocat.tables ("Metaexternalfields"). Columns.Append Ocolumn
' Complete
Set Ocolumn = Nothing
Set OCat = Nothing
Oconn.close ()
Set oconn = Nothing
End Sub
The members of the collection column are:
Item property
Count property.
Delete method.
Refresh method.
For Column objects, see also: Column objects, not tables.