Solved

Synchronising/overwriting an MS Access table on a live site with one from a local filestore.

Posted on 2006-06-30
11
287 Views
Last Modified: 2008-03-03
I have a live website which uses an MS Access database to hold data and uses ASP to interrogate it.
Several tables in the database relate to stock items and cross-referencing to them.
Several other tables relate to user orders.

I want to be able to update the stock item and cross-reference tables on the site whilst keeping the site live and leaving the database accessible.  What is the best way of doing this?

At the moment, I do this very awkwardly by downloading a copy of the site database from the site to my PC ( with the latest set of order information in it ), overwriting the relevant product tables, then quickly uploading it back to the site before someone else places an order on it.  If someone attempts to place an order while I am doing this, there is the risk that my upload of the database will overwrite the order, leaving no record.
0
Comment
Question by:Beamson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
11 Comments
 
LVL 19

Expert Comment

by:peh803
ID: 17018258
Okay -- so you basically want to be able to update a product list (and potentially quantity / inventory figures) with new data, as it becomes available?

How is this new product and inventory data delivered to you (*.dat file, excel, another DB, etc.)?  What data structure do you want it to go in?  Since you're doing this today successfully, I'm not trying to redesign the process -- just trying to understand better what your situation is.

Thanks,
Phil
0
 
LVL 1

Author Comment

by:Beamson
ID: 17018528
Hi Phil,

Periodically (every few days), I am passed an MS Access file from one of my colleagues, containing only up-to-date stock and cross-reference tables.  The structure of the data within the tables is lengthy but to give a sample representation, see the table structures below:

tbl_cross_ref
---------------
record_id
brand
model
our_part

tbl_stock
----------
stock_code
availability
price

The database behind our website (externally hosted) contains identical tables to these (with potentially stale data) plus tables relating to orders which are placed on the site.
0
 
LVL 19

Expert Comment

by:peh803
ID: 17018573
Okay -- and so what you want to do is be able to drop the contents of the existing database and replace all contents with the contents of this newly updated database that is provided by a business partner of yours?

If that's the goal, it should be certainly feasable to set up a process that can do this on the remote server...

Let me know if I understand correctly.

Thanks,
Phil
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:peh803
ID: 17018577
Also, how many columns (approximately) are in the largest table, and how many rows on average?  I just want to get an idea of how much data we're talking about having to import and export.

Thanks,
Phil
0
 
LVL 1

Author Comment

by:Beamson
ID: 17018666
The largest table is the cross-reference table.
Currently, this has 10,000 rows and 10 columns
Over the forseeable lifetime of this project, the number of rows should increase to something like 50,000.

I think your understanding is of the requirement is half-correct - I do want to drop SOME of the tables in the database and replace them (i.e the cross-reference and stock tables).  However, I need to keep the live orders tables intact and unaffected.  Does this make sense?
0
 
LVL 19

Accepted Solution

by:
peh803 earned 250 total points
ID: 17019405
Beamson -- this does make sense to me.

I would recommend that you write a script that will connect to both databases and copy the table from the new database, "databaseNew.mdb", into the existing database, "databaseExisting.mdb".  The best method will probably be to copy all the new records into a temporary table, and then compare the existing records to the new records and update any that may have changed.  I doubt all 50,000 will have changed every time, and updating / inserting only the small percentage of the ones that have changed each time will significantly help, performance wise.

Does this sound like it will solve your issue?  I can, of course, help you with the design of this process.  Just want to make sure it makes sense thus far.

Regards,
Phil
0
 
LVL 1

Author Comment

by:Beamson
ID: 17029800
Hi Phil,

I think this sounds like it will get the right result - just seems like a lot of steps to have to take to get the desired results.

So would it involve something like:

1) Uploading databaseNew.mdb to the site
2) Copying tables from databaseNew.mdb to databaseExisting.mdb (not sure I can do this easily - help would be appeciated!)
3) Running delete, update and append queries between the xxxNew and xxxExisiting tables (messy, but I think I can handle this).
4) Tidy up - delete databaseNew.mdb, all xxxNew tables (could do with help on deleting tables from remote databases using ASP/SQL)
0
 
LVL 19

Expert Comment

by:peh803
ID: 17267679
I am willing to continue to assist the @Beamson if he/she still needs assistance coming up with code to achieve his/her means...

Regards,
peh803 / Phil
0
 
LVL 1

Author Comment

by:Beamson
ID: 17269621
Hi Phil,

Sorry, have been snowed under here and not had time to give this full attention.  I'm going to have a go at following your suggestion (think the queries needed will be cumbersome and numerous but not actually all that difficult in themselves).

Thanks,

  Craig
0
 
LVL 19

Expert Comment

by:peh803
ID: 17274272
@Craig:

Thanks for the grade, but if you still need some assistance with this, let me know!  I'll be happy to continue to help out.

Regards,
Phil / peh803
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Javascript to allow login/password authorization 4 63
Hide Table in merge 3 53
Help with IIS intermittent hangs on Windows 2012 5 64
Boolean 13 50
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question