473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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(VersionRef) and compare it with the
version number of the LocalFile which has the same front-end table.
WorkgroupFileName is determined elsewhere. WorkgroupFileName, 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 = WorkgroupFileName
.DefaultUser = "defaultadmin"
.DefaultPassword = "adminpwd"

' open workspace, database, recordset for Local File.
Set ws = .Workspaces(0)
Set db = ws.OpenDatabase(LocalFile)
Set rs = db.OpenRecordset("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.OpenRecordset("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 5725
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(VersionRef) and compare it with the
version number of the LocalFile which has the same front-end table.
WorkgroupFileName is determined elsewhere. WorkgroupFileName, 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 = WorkgroupFileName
.DefaultUser = "defaultadmin"
.DefaultPassword = "adminpwd"

' open workspace, database, recordset for Local File.
Set ws = .Workspaces(0)
Set db = ws.OpenDatabase(LocalFile)
Set rs = db.OpenRecordset("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.OpenRecordset("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.com" <u6836@uwe> wrote in
news:5e91ce375a5da@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.OpenDatabase(...)

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.OpenDatabase.

--
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
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...
3
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...
3
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...
3
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...
11
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
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...
0
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...
2
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...
0
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...
1
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.