Results 1 to 4 of 4

Thread: 3625 : Item not found in collection...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Location
    Omaha, NE, USA
    Posts
    28

    Angry

    Set UserDB = DBEngine.Workspaces(1).OpenDatabase(App.Path + "Users.mdb")

    In the above code, I get the error "Item not found in collection." Now, I have used this same code with different databases several times. I have done the exact same with this as I have with the others. And ideas?
    - Ovid -

  2. #2
    Lively Member
    Join Date
    Jun 2000
    Posts
    82
    I would normally make a myWS variable containing the dbengine, then open the database separately.
    Also, app.path may not contain a backslash at the end.

    i.e.

    Code:
    dim myWs as Workspace
    dim myDb as Database
    
    Set myWs=dbengine.workspaces(0)
    Set myDB=myWs.OpenDatabase(app.path & "\Users.mdb")
    Try that.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Location
    Omaha, NE, USA
    Posts
    28

    Ack!

    It was my workspaces(1) instead of 0. How do I make a new workspace?
    - Ovid -

  4. #4
    Lively Member
    Join Date
    Jun 2000
    Posts
    82
    Syntax:
    Set workspace = CreateWorkspace(name, user, password, type)

    Example:

    Code:
    Dim wrkODBC as Workspace
    
    Set wrkODBC = CreateWorkspace("ODBCWorkspace", "admin", _
    		"", dbUseODBC)
    	Workspaces.Append wrkODBC

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width