CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2000
    Location
    Ohio
    Posts
    238

    Re ordering a data table

    Is there a way through sql or other methods to simlpy change the ORDER of a table without dropping and re creating the table?



  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Re ordering a data table

    Hi Joe

    What order are talking about

    1.Records order?
    a.You can either write an SQL - select * from YourTable order by YourField
    b.Put index on the field, which automatically displays records in order

    2.Fields order?
    a.what database are working with. In Access you can drag field to any location.
    or you can use SQL instead select * - use select Field2, Field3, Field1. Fields will be displayed in SQL statement order

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Nov 2000
    Location
    Ohio
    Posts
    238

    Re: Re ordering a data table

    It is record order that I am concerned with not field order.

    The dilema im having here is this.

    When I do a select statement I can get a recordset in the correct order. That is great.
    But what I need is the TABLE to be in the correct order. So... I need to do a SELECT INTO the same table. And you cant have the same source and destination tables.


  4. #4
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Re ordering a data table

    Put index on the field(s). It will give you the desired order.

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  5. #5
    Join Date
    Nov 2000
    Location
    Ohio
    Posts
    238

    Re: Re ordering a data table

    Thanks for your help Louri.. I figured it out. Works fine now.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured