Hi, just wondering, right now, my app is being run by at least 2 instances of the same exe, reading and writing to the same database. The most common implemenation is having two computers connect with through a hub and share a drive on one computer and have the other computer run the app on the shared drive. I have noticed some random problems here any there.. Both instances might shut down when a button is pressed at the same time, random crashes, one curropted database. I was wondering if I had my app set up properly to run something like this?
Code:This is the call I make on start up to connect to the database: Dim DB_PATH As String DB_PATH = App.PATH & "\Data.mdb" Set db = OpenDatabase(DB_PATH, False, False, ";pwd=" & DATABASE_PASSWORD)
During the operation of the program, I would open up recordsets and read, write, and edit them.
Are they any other ways I should handle Db connection and writing/editing records for multiuser?Code:dim rs as Recordset set rs = db.OpenRecordset("SELECT * FROM [Items] WHERE [ID] = 5", dbOpenDynaset) with rs .Edit ![Name] = "Apple" .... .... .Update .Close end with
Thanks
John




Reply With Quote