• WSasegelstrom

    WSasegelstrom

    @wsasegelstrom

    Viewing 3 replies - 16 through 18 (of 18 total)
    Author
    Replies
    • in reply to: Access Security (Access 2000) #580250

      Rory,

      Thanks for your reply. The code (the connection string) is inside of a Function that the form calls when it loads. Here is the function…

      Function GetDBConnection()

      ‘Open the Connection Object
      Set Conn = New ADODB.Connection
      Conn.Open “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:My DocumentsdatabasesCurrentCopy(Tonya)ProductReleaseControl.mdb;”

      GetDBConnection = Conn

      End Function

      And here is the VB for the form that calls the function:

      Private Sub Form_Current()

      DoCmd.Maximize

      ‘Open the Connection Object
      Call GetDBConnection

      End Sub

      So, when the “form_current” executes, it calls the function which creates the connection string. The form then uses the Conn object for various tasks. But, I think the database is still locked from the form previously being in design mode and that is why opening the connection is failing. Anyway, as always, any ideas or suggestions are appreciated.

      Regards,

      Amanda

    • in reply to: Access Security (Access 2000) #580235

      Just tried setting a password for Admin User and no luck. I still get the error. I’ve been looking at it all morning again and I think what is happening is when a form is in design mode, the database gets locked so design changes can be made. Then, when the form gets switched back to view mode and the connection string code tries to execute, the lock created while in design mode still exists and the code trying to open the connection fails. So, before I execute the Open command, maybe I need to “close” or “unlock” the database connection that was created while in design mode? I am not sure if that makes any sense, but I am thinking that the problem is not security (like I once thought), but rather a connection problem. Only, I know my ADODB connection “syntax” is fine, it’s just that it errors when I go from design mode to view mode.

      Anyone have any suggestions?

      Regards,

      Amanda

    • in reply to: Access Security (Access 2000) #580216

      Thanks for the help, but, *sigh* unfortunately it didn’t solve the problem. *pout* I went ahead and checked all permissions and they were set correctly – to have full access. When I get the runtime error indicating that “The database has been placed in a state by user ‘Admin’ on machine ‘WEIGET1’ that prevents it from being opened or locked.” it is a “debug” message – meaning I can go in and debug the error. It takes me into VB code that I wrote that connects to the database. The following is the code:

      Set Conn = New ADODB.Connection
      Conn.Open “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:My DocumentsdatabasesProductReleaseControl.mdb;”

      and I am getting the error when I execute the Conn.Open statement – but only when I switch from design mode into view mode. Strange. Anyway, I am guessing that what is happening is that the connection is being created in view mode and then after switching into design mode and then back into view mode the connection is tried again and that is where it is locking up. So, perhaps my question is – How can I create a connection to the database in my VB code that will not cause this error when a user tries to go to and from design mode. Perhaps the connection string that I am using is not the right kind?

      As always, any help is greatly apprecitaed.

      Regards,

      Amanda

    Viewing 3 replies - 16 through 18 (of 18 total)