Situation: There is a database program that stores inventory, say different types of coffee cups. There are clients in many cities using the program for inventory. You want each store to e-mail a copy of the database back once a week so you can check inventory levels and restock each store. You have each store e-mail a copy of the database as an attachment to an e-mail. The attachment is “cupsInventory.rsd”. There might be hundreds of stores sending weekly copies of their database.
I believe that SQLiteDatabase.AttachDatabase will allow the “cupsInventory.rsd” to be attached to a database in your office so you can check inventory. What I’m having a problem with is how to copy the “cupsInventory.rsd” from the e-mail to a list box where I can then open it by double-clicking the file in a list box. I can’t seem to understand how to copy an attachment into a database. The databases, both the attached database and the database used by you are identical as to table and fields.
Can anyone point me in the right direction? I appreciate your help. Thank you.
AttachDatabase does not merge the contents of two database with the same Tables.
Now this may be your question. Did you check at sqlite.com ?
If you only want to load in q ListBox the contents of the attached Data Base, read back the page dedicated to AttachDatabase: it explains how to access to it (you have to use a prefix (the name used in the AttachDatabase line) to query it.
Above the above part, you say you will receive tons of db files. So, at a momment in time:
store the received db files in a folder,
Once done, run a program that will check that folder contents and:
opens that folder,
All each db file name in a ListBox (left part of the window) - ListBox_DBFiles -, storing the FolderItem of that db file into the RowTag,
When the user choose a Row in that ListBox:
In ListBox_DBFiles: take the RowTag value to open the data base file and display its contents in the main ListBox (say ListBox_Inventory) that takes 75% of the window width
create a default Inventory Data Base file,
Add all needed Tables,
fill all these tables with each part number (object in the inventory)
set the minimum default quantity for all entries,
then compare the contents of this Reference data base file to each downloaded inventory data base file and compare all entries / create a list of needed parts (Object Name / reference / ? and Quantity).
This seems good for me from a programmer’s point of view. Now, we all know that a ventilator will be more useful in Florida than (some parts of the year) in Alaska: so more quantities here than there ;-:).