Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

ADO problems Microsoft Jet Access Issues

I wrote this program with ADO connection string to a microsoft access database (.mdb) file. The program is working great when used as a single computer, but I need it to be a shared multiuser database system. I have the DB shared on the network, and mapp the directory as a drive on the client station. When the program runs, it opens the database by the mapped drive directory. Now when I open the program and database to view data on one client, when I open the other client I get an error saying

Run-Time Error
Cannot open file "; File already in use.

I am including the code at the bottome because I don't know if its a setting I need to fix in my ado connection or recordset connection setting.

[code]
Public Function Open_CentexDB()
If CentexDB.State = adStateOpen Then
CentexDB.Close
End If

CentexDriveLetter.MoveFirst
DBDriveLetter = CentexDriveLetter.Fields("Drive").Value

CentexDB.Open "Provider=Microsoft.Jet.OLEDB.4.0;persist security info =false;data source=" & DBDriveLetter & ":databasesCentex.mdb"

End Function

Public Function Open_CentexTable()

If CentexTable.State = adStateOpen Then
CentexTable.Close
End If

With CentexTable
.ActiveConnection = CentexDB
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Source = "SELECT * FROM CentexInfo"
.Open
End With

End Function
[/code]

Those are both functions I open up on form load to view the data. Someone please help me, the company I am building this program for does not wish to buy microsoft SQL server to handle database solutions, they wish to use microsoft access.

Thank you,
The Darthmoob

Comments

  • zaib_awanzaib_awan Member Posts: 9
    : I wrote this program with ADO connection string to a microsoft access database (.mdb) file. The program is working great when used as a single computer, but I need it to be a shared multiuser database system. I have the DB shared on the network, and mapp the directory as a drive on the client station. When the program runs, it opens the database by the mapped drive directory. Now when I open the program and database to view data on one client, when I open the other client I get an error saying
    :
    : Run-Time Error
    : Cannot open file "; File already in use.
    :
    : I am including the code at the bottome because I don't know if its a setting I need to fix in my ado connection or recordset connection setting.
    :
    : [code]
    : Public Function Open_CentexDB()
    : If CentexDB.State = adStateOpen Then
    : CentexDB.Close
    : End If
    :
    : CentexDriveLetter.MoveFirst
    : DBDriveLetter = CentexDriveLetter.Fields("Drive").Value
    :
    : CentexDB.Open "Provider=Microsoft.Jet.OLEDB.4.0;persist security info =false;data source=" & DBDriveLetter & ":databasesCentex.mdb"
    :
    : End Function
    :
    : Public Function Open_CentexTable()
    :
    : If CentexTable.State = adStateOpen Then
    : CentexTable.Close
    : End If
    :
    : With CentexTable
    : .ActiveConnection = CentexDB
    : .CursorLocation = adUseClient
    : .CursorType = adOpenStatic
    : .LockType = adLockOptimistic
    : .Source = "SELECT * FROM CentexInfo"
    : .Open
    : End With
    :
    : End Function
    : [/code]
    :
    : Those are both functions I open up on form load to view the data. Someone please help me, the company I am building this program for does not wish to buy microsoft SQL server to handle database solutions, they wish to use microsoft access.
    :
    : Thank you,
    : The Darthmoob
    :

    Use DSN Connection.
    e.g
    Lcn.ConnectionString = "DSN=DSN Name;database=" & strPath & ";"

Sign In or Register to comment.