remote DAO access to a db
shane -- shane@datatree.com Tuesday, February 13, 1996 If anyone can help here I would appreciate it! I have a MS Access database that I want to be able to access from a remote machine with the DAO database classes. When the program is running on the remote machine it tries to connect to the database on another by calling: m_pDB->Open("x:\\ACCESS\\BENCH.MDB", FALSE, FALSE, NULL); These are both windows95 machines and the remote user has the 'x:' drive mapped to the drive where the database resides. On that remote machine I catch the error: Couldn't open file 'x:\access\bench.mdb' This works fine on the machine where the database actually resides. Questions: How can I enable the remote machine access the the database? How (and who) controls the locking if two different machines are trying to access the same record or page of the database? Any help would be greatly appreciated!!
Rohit Namjoshi -- namjoshi@slb.com Friday, February 16, 1996 I had a similar problem with DAO access to an .MDB file from several machines in an NT domain. In my case, I requested non-exclusive read-only access (m_pDB->Open(lpszPathName, FALSE, TRUE);). Only one user could access the file at a time. Attempting to access it while another user was accessing it threw an exception with the description "Failed to lock file [3050]". The code 3050 is not documented in MSJETERR.HLP. When the first user accessed the file I noticed that a file with the same name as the database but with extension .LDB was being created on the share where the database resided. This file was owned by the first user with exclusive read/write access and I guess that is what prevented other users from accessing the database. When the first user stopped accessing the database, the .LDB file was deleted automatically. To get around this problem, I made a copy of the .LDB file before it was deleted and changed its permissions to allow domain users full control. With this file in place, multiple users could access the database. Cheers... Rohit -- Rohit Namjoshi namjoshi@austin.asc.slb.com Schlumberger Austin Systems Center Vox: +1 512 331 3353 Austin, TX 78726, USA Fax: +1 512 331 3320 ---------- From: shane[SMTP:shane@datatree.com] Sent: Tuesday, February 13, 1996 9:04 To: mfc-l@netcom.com Subject: remote DAO access to a db If anyone can help here I would appreciate it! I have a MS Access database that I want to be able to access from a remote machine with the DAO database classes. When the program is running on the remote machine it tries to connect to the database on another by calling: m_pDB->Open("x:\\ACCESS\\BENCH.MDB", FALSE, FALSE, NULL); These are both windows95 machines and the remote user has the 'x:' drive mapped to the drive where the database resides. On that remote machine I catch the error: Couldn't open file 'x:\access\bench.mdb' This works fine on the machine where the database actually resides. Questions: How can I enable the remote machine access the the database? How (and who) controls the locking if two different machines are trying to access the same record or page of the database? Any help would be greatly appreciated!!
Mike Blaszczak -- mikeblas@msn.com Wednesday, February 28, 1996 ---------- From: owner-mfc-l@netcom.com on behalf of shane Sent: Tuesday, February 13, 1996 07:03 > I have a MS Access database that I want to be able to access from a remote > machine with the DAO database classes. When the program is running on the >remote machine it tries to connect to the database on another by calling: > > m_pDB->Open("x:\\ACCESS\\BENCH.MDB", FALSE, FALSE, NULL); It's surprising to me that this call works--I didn't know the lpszConnect parameter could be NULL. >These are both windows95 machines and the remote user has the 'x:' drive > mapped to the drive where the database resides. On that remote machine I > catch the error: > Couldn't open file 'x:\access\bench.mdb' Does the connected machine have read _and_ write access to the share point? What happens if you try to open the database with Microsoft Access? > How (and who) controls the locking if two different machines > are trying to access the same record or page of the database? DAO controls locking. All of the rules DAO uses for locking are discussed in the Jet Database Engine Programmer's Manual. The rules might be in the DAO SDK, too. .B ekiM TCHAR sz[] = _T("These words are my own; I do not speak for Microsoft.");
| Вернуться в корень Архива |