Alibaba2003
Programmer
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.
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
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
It's Nice to Be Important But It's more Important to BE Nice