[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Workspace

Posted on 1998-05-27
3
Medium Priority
?
467 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 120 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

649 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