Results 1 to 5 of 5

Thread: [RESOLVED] Passing data from excel to access

  1. #1

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Resolved [RESOLVED] Passing data from excel to access

    Hello everyone,
    I know how to read from excel..and how to insert into access database.
    But it just doesnt work that easy for me.
    I have some 10 columns in the excel sheet...
    and I have 5 columns in the access database.

    I want to just insert certain selected 5 columns into the access database...
    Please help me with this someone..
    Thanks
    Godwin

    Help someone else with what someone helped you!

  2. #2

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Re: Passing data from excel to access

    I have a really really long code Ive tried...Its using the oledbreader,command,etc...I retrieved the data into a hashtable and tried inserting into access db.But,well it fails very very horribly.Please help me,Thanks.
    Godwin

    Help someone else with what someone helped you!

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

    Re: Passing data from excel to access

    You can just use ADO.NET. One OleDbDataAdapter and two OleDbConnections. The SelectCommand has a connection to Excel and the InsertCommand has a connection to Access. Set the AcceptChangesDuringFill property of the adapter to False. Write you SQL to retrieve and then insert the data, then call Fill to populate a DataTable and Update to save it to Access.
    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

  4. #4

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Re: Passing data from excel to access

    Thanks Jm,
    Thats Exactly what I did and it gave me errors..It was because of my careless programming...
    Thanks
    Godwin

    Help someone else with what someone helped you!

  5. #5

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Re: [RESOLVED] Passing data from excel to access

    Forgot to mark this as resolved..Did it now
    Godwin

    Help someone else with what someone helped you!

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