Solved

Workspace

Posted on 1998-05-27
3
460 Views
Last Modified: 2006-11-17
Hi

Why the first two lines in the following code cause error in my PC?
Since the third line in the following code can work, why we need to set workspace?
What about workspace(1) and workspace(2)?

set NewWs = DBEngine.WorkSpace(0)
set NewDB = NewWs.OpenDatabase("thefile.mdb", dbLengGeneral)

set NewDB = OpenDatabase("thefile.mdb", dbLengGeneral)
0
Comment
Question by:victorlong
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 40 total points
ID: 1461775
victorlong,
your error probable in WorkSpace(0). It should be workspaces(0).

You don't have to specify workspace.

Regards
Dalin
0
 

Author Comment

by:victorlong
ID: 1461776
Hi Dalin.

You are right.

But what is a workspace in VB?

I also tried
set NewWs = DBEngine.WorkSpaces(1)
and got error :-(

Cheers.
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1461777
victorlong,
You may search for Workspace object (DAO) from the Online help to see what iit is or what it does.

When You first refers to workspace, the jetengine automatically creats workspaces(0).
If you want to use other work spaces, you need to create it by use the CreatWorkspace method then then appending to the collection.

Hope I made myself clear. If you have any additional questions, feel free to ask. You can email me Dalin_N@mailExcite.Com
Regards
Dalin

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question