B
Bnielsen
I'm fumbling through a procedure to programically add columns to an existing
table. The purpose of this is to send an updating database that when launched
- updates objects in another database. So far, the only way I can add fields
is using the .append method as follows:
Dim dbUpdateCatalog As ADOX.Catalog
Set dbUpdateCatalog = New ADOX.Catalog
'---Assign connection string to remote connection
dbRemoteConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & strBackEndDB
'---Open remote connection
dbRemoteConnection.Open
'---Associate ADOX catalog with remote connection
dbUpdateCatalog.ActiveConnection = dbRemoteConnection
For num = 0 To (numrows - 1)
With dbUpdateCatalog.Tables(vardata(0, num)).Columns
.Append vardata(1, num), vardata(2, num)
.Refresh
End With
I have had no luck trying to construct new columns using ADOX.Columns. I
would like the ability to set other properties besides type and fieldsize.
There doesn't seem to be a way to modify properties for existing columns
either....HELP!! This ADOX stuff doesn't work the way the Access Developer's
Handbook says it should.
Thanks in advance
Bryan
table. The purpose of this is to send an updating database that when launched
- updates objects in another database. So far, the only way I can add fields
is using the .append method as follows:
Dim dbUpdateCatalog As ADOX.Catalog
Set dbUpdateCatalog = New ADOX.Catalog
'---Assign connection string to remote connection
dbRemoteConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & strBackEndDB
'---Open remote connection
dbRemoteConnection.Open
'---Associate ADOX catalog with remote connection
dbUpdateCatalog.ActiveConnection = dbRemoteConnection
For num = 0 To (numrows - 1)
With dbUpdateCatalog.Tables(vardata(0, num)).Columns
.Append vardata(1, num), vardata(2, num)
.Refresh
End With
I have had no luck trying to construct new columns using ADOX.Columns. I
would like the ability to set other properties besides type and fieldsize.
There doesn't seem to be a way to modify properties for existing columns
either....HELP!! This ADOX stuff doesn't work the way the Access Developer's
Handbook says it should.
Thanks in advance
Bryan