Re: Updating column property on table gives error



Uwe wrote:
I finally got it to work. One has to update the properties before the
append and the append needs to use the .name.
oTableDest.Columns.Append colDB.name works
However, there is a serious issue now. The properties you set do not
populate the column correctly.
I printed the properties after they were set but before the append
and then after the append and they do not match.

For instance
the type in the original column is 3 and after the append is 202.
The autoincrement is true before the append and false after.
It seems that the append simply uses some default set of values.


Well, a read of the documentation
(http://msdn.microsoft.com/library/en-us/ado270/htm/admthappendcolumns.asp)
explains this:

Parameters
Column
The Column object to append or the name of the column to create and
append.
Type
Optional. A Long value that specifies the data type of the column. The
Type parameter corresponds to the Type property of a Column object.
DefinedSize
Optional. A Long value that specifies the size of the column. The
DefinedSize parameter corresponds to the DefinedSize property of a Column
object.

So, if you supply a string in the first argument, a new column object is
created with default type and defined size.

I would suggest attempting to determine which of the property settings is
causing the "multi-step" error to occur when appending the Column object.
This will probably require creating and appending a column for each property
you need to set, trapping the error when it occurs so you can see which
property setting is causing the error.

PS. This task would probably be much simpler if you used DAO.


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: Updating column property on table gives error
    ... append and the append needs to use the .name. ... The autoincrement is true before the append and false after. ... DefinedSize parameter corresponds to the DefinedSize property of a Column ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • Re: Updating column property on table gives error
    ... in code instead of when the append happens. ... Please reply to the newsgroup. ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)