+ Reply to Thread
Results 1 to 6 of 6

Add data from an automatic updated excel to access table

  1. #1
    Registered User
    Join Date
    05-22-2007
    Posts
    6

    Question Add data from an automatic updated excel to access table

    Hi I have an excel worksheet that does the following every 20 minuts : 1.delete all data; 2.connect to a specific site on the internet and get new data; 3.save the new file.
    I need the new data after it has been updated to be ADDED to an existing Access table.
    my problem is that I can't transfer the data and ADD it to the access table.
    does any one have an idea on how to do that ?
    p.s.
    I think there is an AFTERUPDATE function in excel so if that is true then how do I edit it to write to the access ,because that would solve my problem.
    thank you all
    udi

    A bit more info :
    I tryed to add to the excel command(after the data download) a dataset to read the data from the sheet and then with an "INSERT INTO" sql command but it does not recogniaze the needed class for OLEDB optioins(wich is probbly something I did wrong)
    I was trying to find an AFTER-UPDATE command in excel but didn't find it.
    what I think I need is help with how do I take the new data and add it to the access table
    p.s.
    the excel file is open at all time and the access file does not have to be - it's all good(open or closed)
    thank you in advance
    udi

  2. #2
    Registered User
    Join Date
    11-16-2006
    Posts
    80
    Example: Just say your excel spreadsheet data contains customers with two columns,

    Col A ColB
    Name Address

    You have database called 'Your Database.mdb' with a table named 'Customers' with two fields, 'Name' & 'Address'. The following code will upload all the names and address' in col A & B to the 'Your Database.mdb' database, 'Customers' table, 'Name' & 'Address' fields. Im sure you could adapt this to your code. If you provide details of your spreadsheet and database it would be a lot easier.

    Please Login or Register  to view this content.
    Havent tested the above

    HTH,
    mccreaso

  3. #3
    Registered User
    Join Date
    05-22-2007
    Posts
    6

    Angry I tryed it but it gives me an "undefind type" eror for the ADODB

    thanks for the help it's seems like what I need but the vbEditor does not recognaize the variable type (give a user defined type not defined copmile eror)
    here is the whole code(both the web update an the new sub()
    Please Login or Register  to view this content.
    I think may be I need to import somthing but I tryed to do :"import System."
    and then CTRL+SPACE but nothing seems to be appropriate.
    hope you can save me again
    thanx udi
    p.s
    I'm using office 2003 pro...

  4. #4
    Registered User
    Join Date
    11-16-2006
    Posts
    80
    Should have mentioned, you need to set a reference to the appropriate object library?

    Under Tools>References... in the VB Editor

    Try adding the reference:

    Microsoft ActiveX Data Objects 2.0 Library

    HTH,
    mccreaso

  5. #5
    Registered User
    Join Date
    05-22-2007
    Posts
    6

    Thumbs up Thank you very much !!!!

    Its working like a charm now !!!
    thank you for you're help !!!

  6. #6
    Registered User
    Join Date
    11-16-2006
    Posts
    80
    No problem, thanks for the challenge!

    mccreaso

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1