Results 1 to 4 of 4

Thread: Inserting a Row in Access @ a Certian Position

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2007
    Posts
    258

    Inserting a Row in Access @ a Certian Position

    Hello. I have a fairly simple issue that needs to be resolved.

    How would I go about inserting a NEW ROW into a Access Table @ a Certain Position.


    Example:

    I have 4 Rows:

    Wesley
    Wesley
    Bob
    Jane

    Now. say I want to input another row and it contains the word Wesley, how would I go about inserting Wesley above Bob? Or even better, Just leave it as it is (Inserting @ the one Below the Last) but now, When I call it, Only want to call rows that Contain the Word Wesley?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Inserting a Row in Access @ a Certian Position

    You don't insert rows into a database at a specific position. You just insert them and they get added to the end of the table. The order of the records in the database is meaningless because you can get them in any order you want by using the appropriate SQL code. To get all the rows with all the Wesleys group together you would order by that column, e.g.
    SQL Code:
    1. SELECT * FROM MyTable ORDER BY Name
    assuming that that data is in a column called "Name". If you wanted just the rows that contain Wesley that would be:
    SQL Code:
    1. SELECT * FROM MyTable WHERE Name = 'Wesley'
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2007
    Posts
    258

    Re: Inserting a Row in Access @ a Certian Position

    Thanks very much Jmcilhinney, Always much help when needed

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Inserting a Row in Access @ a Certian Position

    If you're not sure how to get data from a database in VB then follow the Data Access link in my signature.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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