Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Jul 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access SQL (Access XP)

    I need to use Access SQL to add 10 names to my database. This is a school project. The only hint we got was that the INSERT command will not add 10 items, so we must create some kind of loop or we can use notepad and have Access use that to enter the data.
    Where can I go to get examples of how to do this? I have had no luck in my books.

    Thanks
    Rbelly

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Access SQL (Access XP)

    What are you trying to do with notepad? If you explain more, maybe someone can help you. Are you wanting to enter a list of names to be added or what? And surely a single name field isn't all that your table contains, is it? Where are you going to get any additional data required to save the records?
    Charlotte

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access SQL (Access XP)

    You could create a text file using NotePad. Put each name on a separate line; if you need to include several fields, separate them by tabs, or make each field a fixed width.
    Use an append query to add the records from the text file to the Access table. Since this is a school project, try to find out how to create the append query yourself. If you succeed, you'll have learned more than if you just copy cook-book instructions.

  4. #4
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Access SQL (Access XP)

    To add to Hans suggestion.

    If you need to do this in a multi step process, Using Notepad, type the data you want to add to the database in the same structure as the access table that the data will be appended to. Save the Notepad file as a text file. In access, use File, Get External Data Import in Text format and select the file to import the data to a table. Create a query that selects the data you just imported and modify it to an append query to append the data to the table and fields you require.
    Regards,

    Gary
    (It's been a while!)

  5. #5
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Access SQL (Access XP)

    ... you say you need to use access Sql to do this. Suggest creating a macro to do the steps previously outlined other then creating the Notepad file. Convert the Macro to code and then modify the code to Access VB.

    HTH
    Regards,

    Gary
    (It's been a while!)

  6. #6
    Star Lounger
    Join Date
    Jul 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access SQL (Access XP)

    I just read about append querys in Alison Balter's book, Mastering Access 2002 Desktop Dev. and I will try that with the notepad idea. I have to use Access SQL for the class.

    I will try tonight and let everyone know where I need help

  7. #7
    Star Lounger
    Join Date
    Jul 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access SQL (Access XP)

    <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35>
    I got it to work!

    Thank you ALL for pointing me in the right direction
    Rbelly

Posting Permissions

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