473,964 Members | 4,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error 3051 when opening workgroup-secured file

I'm getting Error 3051 with the following snippet of code. What I'm trying
to do is to open an update version on the server (ServerFile) to check it's
version number in a front-end table(VersionRe f) and compare it with the
version number of the LocalFile which has the same front-end table.
WorkgroupFileNa me is determined elsewhere. WorkgroupFileNa me, ServerFile
and LocalFile are all correct (I've stepped through the code to verify that
they are correct). The 3051, permissions error, occurs on the line indicated,
when trying to open the ServerFile.

Is using this method the correct way to open workgroup secured files. This
used to work fine, until I started using Access 2003. It still works fine
with A2K, but not A2003.

Set dbe = New PrivDBEngine

With dbe
' start Jet.
.SystemDB = WorkgroupFileNa me
.DefaultUser = "defaultadm in"
.DefaultPasswor d = "adminpwd"

' open workspace, database, recordset for Local File.
Set ws = .Workspaces(0)
Set db = ws.OpenDatabase (LocalFile)
Set rs = db.OpenRecordse t("SELECT * FROM VersionRef", dbOpenSnapshot)
LocalDBType = rs("DB_TYPE")
LocalVersion = rs("Version")
rs.Close
db.Close

' open workspace, database, recordset for Server File.
Set ws = .Workspaces(0)
Set db = ws.OpenDatabase (ServerFile)
'ERROR 3051 occurs on the following line.
Set rs = db.OpenRecordse t("SELECT * FROM VersionRef", dbOpenSnapshot)
FreshDBType = rs("DB_TYPE")
FreshVersion = rs("Version")
rs.Close
db.Close

End With

--
Message posted via http://www.accessmonster.com
Apr 10 '06 #1
2 5766
Correction:

The error actually occurred on the following line:

Set db = ws.OpenDatabase (ServerFile)

rdemyan wrote:
I'm getting Error 3051 with the following snippet of code. What I'm trying
to do is to open an update version on the server (ServerFile) to check it's
version number in a front-end table(VersionRe f) and compare it with the
version number of the LocalFile which has the same front-end table.
WorkgroupFileN ame is determined elsewhere. WorkgroupFileNa me, ServerFile
and LocalFile are all correct (I've stepped through the code to verify that
they are correct). The 3051, permissions error, occurs on the line indicated,
when trying to open the ServerFile.

Is using this method the correct way to open workgroup secured files. This
used to work fine, until I started using Access 2003. It still works fine
with A2K, but not A2003.

Set dbe = New PrivDBEngine

With dbe
' start Jet.
.SystemDB = WorkgroupFileNa me
.DefaultUser = "defaultadm in"
.DefaultPasswor d = "adminpwd"

' open workspace, database, recordset for Local File.
Set ws = .Workspaces(0)
Set db = ws.OpenDatabase (LocalFile)
Set rs = db.OpenRecordse t("SELECT * FROM VersionRef", dbOpenSnapshot)
LocalDBType = rs("DB_TYPE")
LocalVersion = rs("Version")
rs.Close
db.Close

' open workspace, database, recordset for Server File.
Set ws = .Workspaces(0)
Set db = ws.OpenDatabase (ServerFile)
'ERROR 3051 occurs on the following line.
Set rs = db.OpenRecordse t("SELECT * FROM VersionRef", dbOpenSnapshot)
FreshDBType = rs("DB_TYPE")
FreshVersion = rs("Version")
rs.Close
db.Close

End With


--
Message posted via http://www.accessmonster.com
Apr 10 '06 #2
"rdemyan via AccessMonster.c om" <u6836@uwe> wrote in
news:5e91ce375a 5da@uwe:
The error actually occurred on the following line:

Set db = ws.OpenDatabase (ServerFile)


I was Googling on a completely different set of errors this morning
and ran across a thread where somebody found that this:

Dim dbe As New DBEngine
Set db = dbe.OpenDatabas e(...)

solved a similar kind of problem.

I'm not sure why you're using a separate workspace object for this,
anyway, since you're using the default workspace.

Indeed, it seems to me that you should be able to open your database
with DBEngine.OpenDa tabase.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Apr 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2417
by: Aaron | last post by:
Hi Guys, I have a dbase installed on a network where the clints have linked tables to the database on the server. I found that i had to make some minor changes to the tables on the server where the client databases look to for their data after I made the changes I tried to open one of the clients databases and found that I was getting an error 3051 open exclusive where when the client tries to connect to the tables on the server it...
3
4321
by: JaBo | last post by:
Our company computers were recently upgraded to Windows XP with Microsoft Office 2003. We have 3 different Access Databases (in different directories on our network) which all require the user to be part of a "Workgroup". It appears that Access 2003 includes some added security features that prevent the user from accessing a database unless you join the workgroup corresponding to the database. This works fine, unless you need to join...
3
4743
by: Mark | last post by:
I have a server in a workgroup (called "wg"). Does anyone know how to find the name of the workgroup from code (pref c#)? I've trawled the newsgroups and the MSDN site for the right class / method / property to use but I just can't find the right one. There are plenty (such as UserDomainName) that give me the server name, but none that I can find to give me the actual workgroup name. TIA Mark
3
8980
by: zav | last post by:
Hi all. Getting stright to the point Im trying to get and set my computers workgroup name but im having litle luck, i've tryed: Environment.UserDomainName Environment.MachineName but they only retreive the local machine name.
11
2879
by: Phil | last post by:
Hi, I've currently setup a local user as described in: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnne...
8
15414
by: rdemyan via AccessMonster.com | last post by:
In 12 months of working on my app, I have never had a corruption problem with the backends, often with the front end but never the backends. So, of course, now that I'm planning to roll a new version of the app out next week, I suddenly had a problem. Here's the development configuration 1) Computer #1 a) Access 2000 - app is developed on this machine
0
2277
by: umshamma | last post by:
I am creating an asp programm for our employee leaves tracking... i am getting this error ADODB.Recordset (0x800A0E7D) The connection cannot be used to perform this operation. It is either closed or invalid in this context. /leave/add_to_leave.asp, line 16 here is the code: <% 'Dimension variables
2
2786
by: Ivan | last post by:
Hi, I experienced a problem while upgrading from DB2 UDB LUW Workgroup edition 7.2 FixPak 10a to Workgroup Server edition 8.2 FixPak 12. The install wizard said the upgrade was successful but none of the MIGRATE commands worked due to authorization problems. The install log showed the following message for each instance - 1: ERROR:An error occurred while creating the instance "DB2". The return code is "-1959". Create the instance...
0
1478
by: EJO | last post by:
Thanks everyone! My workgroup is in a mixed enviroment for using an Access 2k mde as the front end of a sql server 2000 which is running on the same machine that some of my users access using Win2003 server terminal services. 1. users on the terminal server, co-located with the sql server, have no problems 2. users on their local machine (Win XP), get an error message:
1
3124
by: =?Utf-8?B?Q29lbg==?= | last post by:
When I right click on My Computer, manage, I get a pop-up with the title "SQL Server Configuration Manager" In the pop up appears the following message: "MMC has detected an error in a snap-in. It is recommended that you shut down and testart MMC" What should I do to avoid and solve this problem. (Server 2003 R2 with SQL Server 2005 with or without SP1) thanks
0
10307
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10127
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11768
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11510
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
8414
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7566
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6499
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3709
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.