Solved

Workspace

Posted on 1998-05-27
3
457 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…

914 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now