Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting up the description property of a field (AllTables)

Status
Not open for further replies.

Alibaba2003

Programmer
Mar 31, 2003
67
US
I field information for database tables stored in a table. i want to get that information to update a database with the same structure. the main purpose is to update the description of the columns or fields. Here is what i wrote:
Commented Lines Have Problem. I dont know how to make the string value of the fields the current table or columns.
Code:
Function UpdateFieldDefinition()
    Dim cat As ADOX.Catalog
    Dim col As ADOX.Column
    Dim tbls As ADOX.Tables
    Dim tbl As ADOX.Table
    Dim dbsConn As New ADODB.Connection
    Dim rUpdateTables As New ADODB.Recordset
    
    Set dbsConn = CurrentProject.Connection
    
    rUpdateTables.Open "TableFieldDefinition", dbsConn, adOpenKeyset, adLockOptimistic
    
    Set cat = New ADOX.Catalog
    cat.ActiveConnection = CurrentProject.Connection
    Set tbls = cat.Tables
    
    Do While Not rUpdateTables.EOF
    Set tbl = rUpdateTables!TableName ' i want to make current field value the current table
    Set col = rUpdateTables!FieldName '?? set the field name to current column name
    col.Properties("Description") = rUpdateTables!FieldDescription 'set column description property to current description field
    rUpdateTables.MoveNext
    Loop

    
        
End Function
Now i dont know how to tell the program to convert the table and the column names to Table and column? Please commented lines in code. Thanks

It's Nice to Be Important But It's more Important to BE Nice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top