RE: Getting Column Order MS Access, or Copy Table



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
>
>
>
.



Relevant Pages

  • Getting Column Order MS Access, or Copy Table
    ... I have some code which copies tables from one Access database to another. ... I guess I could iterate an Array of column names, but I need to put them in ... If I can't get this code to work, I guess I scrap this code and use ... Prev by Date: ...
    (microsoft.public.data.ado)
  • Access form fields to Word Form
    ... I have an Access Database that I want to export about information from four ... fields on the current record to a word document. ... that will populate these fields and then automatically print the document ... Prev by Date: ...
    (microsoft.public.word.mailmerge.fields)
  • Help - How to join two datasets
    ... My task is to identify duplicate records in 2 tables that each located in ... different Access database. ... Roy ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: form genrated for some records not for others
    ... > i have an access database where i generate forms from individual records. ... > on how i should go about finding and correcting the problem. ... Prev by Date: ...
    (microsoft.public.access.forms)
  • download to access in real time
    ... any one out there can help with creating a report in frontpage to downlaod ... data to an access database in real time. ... Prev by Date: ...
    (microsoft.public.frontpage.programming)