RE: Getting Column Order MS Access, or Copy Table
- From: "Mark S." <MarkS@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Sep 2005 11:51:22 -0700
How do you populate tblS?
"JZ" wrote:
> Hi,
>
> I have some code which copies tables from one Access database to another.
>
> First I copy the table, then the columns, then the data.
>
> My problem is that columns are copied in alphabetical order, not in the
> order that they appear in the source table.
>
> Heres my code.
>
> for lintArrInc2 = 0 to tblS.Columns.Count -1
>
> oColumn = New OLEObject("ADOX.Column")
>
> oColumn.Name = tblS.Columns(lintArrInc2).Name
> oColumn.Type = tblS.Columns(lintArrInc2).Type
> oColumn.ParentCatalog = CatD' Must set before setting properties
> oColumn.DefinedSize = tblS.Columns(lintArrInc2).DefinedSize
> oColumn.NumericScale = tblS.Columns(lintArrInc2).NumericScale
> oColumn.Precision = tblS.Columns(lintArrInc2).Precision
> oColumn.Attributes = tblS.Columns(lintArrInc2).Attributes
>
> catD.Tables(lstrSelectedTableName).Columns.Append(oColumn)
>
> next lintArrInc2
>
> I guess I could iterate an Array of column names, but I need to put them in
> order.
>
> If I can't get this code to work, I guess I scrap this code and use
> something else entirely.
> But I haven't seen anything which would work as good.
>
> Any suggestions?
>
> Thanks in advance!
>
> JZ
>
>
>
.
- References:
- Prev by Date: MSSQL Connection question
- Next by Date: RE: MSSQL Connection question
- Previous by thread: Getting Column Order MS Access, or Copy Table
- Next by thread: Re: Getting Column Order MS Access, or Copy Table
- Index(es):
Relevant Pages
|