Connecting Tech Pros Worldwide Forums | Help | Site Map

open mode : adModeShareDenyNone

Newbie
 
Join Date: Dec 2007
Posts: 9
#1: Dec 5 '08
Hi All,

We use “adModeShareDenyNone” open mode to allow others users to connect to database at the same time.
But when I open database through one client on computer, other user(computer) can not connect to database. It gets an error saying “file already in use”.
What can be the reason?

Note :: I have distributed .exe (front end) to different users.

## some part of code (visual basic)
'declare connection
Dim ConDB As ADODB.Connection
'declare SQL command
Dim myCommand As ADODB.Command
'declare record set to store output of SQL command
Dim myRecordSet As ADODB.Recordset

'To catch run-time errors
'On Error Resume Next
'Setting connection object
Set ConDB = New ADODB.Connection
'creating new record set
Set myRecordSet = CreateObject("ADODB.Recordset")
'setting cursor type
myRecordSet.CursorType = adOpenStatic
'setting connection provider engine
ConDB.Provider = "Microsoft.Jet.OLEDB.4.0"

'clearing errors
Err.Clear
'let each user connect to database
ConDB.Mode = 16 'adModeShareDenyNone
'Opening connection
ConDB.Open CONNECTION_STRING <- declared constant in module

FishVal's Avatar
Expert
 
Join Date: Jun 2007
Location: Israel
Posts: 2,584
#2: Dec 7 '08

re: open mode : adModeShareDenyNone


Hello, Anane.

Access doesn't support all ADO features.
Try different connection modes or open it in default adModeUnknown.

Regards,
Fish
Reply