Simply put, I am trying to rename a column.
However whenever I execute the following code (for a delete) I get a run-time error: Operation not supported on a table that contains data.
I think this is wrong, as I can open the file in access and run a sql command to do the same thing and it runs fine. Why would I need an empty database?
Is the code sound, or is it a problem with the Jet engine?
Although I used the following for this post, I also attempted to run a sql statement through a command connected to the same connection and got the same error. I have also attempted the delete and append through a recordset running on the same connection, again, with the same error. This is why I am thinking that it may have something to do with the jet.
Any help would be greatly appreciated,
Daniel
// visual basic 6.0
dim tmpConnection as ADODB.Connection
dim adoxCatalog as ADOX.Catalog
set tmpConnection = ADODB.Connection
tmpConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & " Data Source=c:\dbases\; Extended Properties=""DBASE IV;"";"
Set adoxCatalog = New ADOX.Catalog
adoxCatalog.ActiveConnection = tmpConnection
' myFile.dbf is a dBase 4 file
adoxCatalog.Tables("myFile").Columns(1).name ' does return a value
adoxCatalog.Tables("myFile").Columns.delete(1) ' I get the error here
adoxCatalog.Tables("myFile").Columns(1).name="newN ame" ' same error here
...