PC Review


Reply
Thread Tools Rate Thread

Database Rights HAve Changed

 
 
=?Utf-8?B?SmltQg==?=
Guest
Posts: n/a
 
      31st May 2005
I have a split database. I wrote a routine in the front end that adds two
tables in the back end, sets links to the front end and then creats a
relationship in the backend between the two tables. After I do this, I no
longer have exclusive rights to the front end database. I get an error
message of:
"You no longer have exclusive access to the database. Your design changes
cannot be saved at this time. Do you want to close without saving your
changes ?"

When I click yeas to close without changes, I get another error which reads:
"The save operation failed" and can't close the fdatabase without the
windows task manager.

From this point on, the database is unusable.

Any help willl be gratly appreciated.
 
Reply With Quote
 
 
 
 
TC
Guest
Posts: n/a
 
      1st Jun 2005
Show us the line of code on which you get that error (and the dozen or
so lines around it).

TC

 
Reply With Quote
 
=?Utf-8?B?SmltQg==?=
Guest
Posts: n/a
 
      1st Jun 2005
I Have included the two subroutines that call the code. I played with the
database some more. The problem occurs even before I create the tables in
the backend database. It occurs even after I just check to see if the tables
exist. Also, it seems that once the error occurs, MS Access has that
database locked by name. For example if I create a blank database and import
all the objects from the locked dtaabase (then delete the locked database), I
can modify the objects as long as I don't run the code that opens the backend
database. However, if I rename that database to the one that was corrupted
(the one I just deleted), It then gives the same error (I no longer have
exclusive rights).

Sub CheckInitialUpgrade()

On Error GoTo Err_CheckInitialUpgrade
Dim strdbPath As String, strNewTable As String, strdbName As String
Dim dbRemote As DAO.Database

'Set the path for the database (use the system default path)
strdbPath = DLookup("HomePath", "tblSystemDefaults", "RecordID = 1")

strdbName = strdbPath & "\dbOMSData.mdb" ' Don't rename remote database name

strNewTable = "tblVersionTracking"
Set dbRemote = OpenDatabase(strdbName)

'Check if new Table Exists, if not initial version upgrade hasn't been done
If funcTableExists(strNewTable, dbRemote) = False Then
If FormattedMsgBox("This database is still Version 2.0.1@Do you wish to
perform the intial " _
& "upgrade to version 3.0.1?@", vbYesNo, "Initial Upgrade Not
Performed") = vbYes Then
Call VersionUpgradeOne(dbRemote) ' Doesn't need to get here for
error to happen
End If
End If
'
Exit_CheckInitialUpgrade:
Exit Sub

Err_CheckInitialUpgrade:
MsgBox Err.Description
Resume Exit_CheckInitialUpgrade

End Sub
Public Function funcTableExists(strTable As String, dbRemote As Database) As
Boolean
On Error GoTo ErrorPoint

' This function will check to see if a
' table exists within the backend database
Dim doc As DAO.Document

With dbRemote.Containers!Tables
For Each doc In .Documents
If doc.Name = strTable Then
funcTableExists = True
Exit For
End If
Next doc
End With

ExitPoint:
On Error Resume Next
Exit Function

ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " & Err.Description _
, vbExclamation, "Unexpected Error"
Resume ExitPoint

End Function

"TC" wrote:

> Show us the line of code on which you get that error (and the dozen or
> so lines around it).
>
> TC
>
>

 
Reply With Quote
 
TC
Guest
Posts: n/a
 
      2nd Jun 2005
I've mentioned a few points about your code; see below.

But I'm not clear exactly what error you are getting on or after
exactly what lines. Can you clarify that please?

HTH,
TC


' I suggest that you temporarily comment-out the following line. Then,
if a runtime error occurs, you will see exactly /where/ it occurs.

On Error GoTo Err_CheckInitialUpgrade


' This line should say DBENGINE.OpenDatabase. You can get all kinds of
weird errors if you use methods of the dbengine object without the
dbengine qualifier; for example, DAO licencing errors, and the
inability to create an MDE.

Set dbRemote = OpenDatabase(strdbName)


Public Function funcTableExists(strTable As String, dbRemote As
Database) As Boolean

Overly complex. All you need is:

dim s as string
on error resume next
s = dbRemote.tabledefs(strTable).name
funcTableExists = (err.number = 0)
end function

HTH,
TC

 
Reply With Quote
 
=?Utf-8?B?SmltQg==?=
Guest
Posts: n/a
 
      3rd Jun 2005
Thanks for the help. The problem was definitely in not using the DBengine
qualifier. I declared a workspace object ws as DBengine.workspaces(0) and
then used ws.OpenDatabase and everything worked after that.

Thanks again!

JimB

"TC" wrote:

> I've mentioned a few points about your code; see below.
>
> But I'm not clear exactly what error you are getting on or after
> exactly what lines. Can you clarify that please?
>
> HTH,
> TC
>
>
> ' I suggest that you temporarily comment-out the following line. Then,
> if a runtime error occurs, you will see exactly /where/ it occurs.
>
> On Error GoTo Err_CheckInitialUpgrade
>
>
> ' This line should say DBENGINE.OpenDatabase. You can get all kinds of
> weird errors if you use methods of the dbengine object without the
> dbengine qualifier; for example, DAO licencing errors, and the
> inability to create an MDE.
>
> Set dbRemote = OpenDatabase(strdbName)
>
>
> Public Function funcTableExists(strTable As String, dbRemote As
> Database) As Boolean
>
> Overly complex. All you need is:
>
> dim s as string
> on error resume next
> s = dbRemote.tabledefs(strTable).name
> funcTableExists = (err.number = 0)
> end function
>
> HTH,
> TC
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Admin Rights Changed =?Utf-8?B?S2V2aW4=?= Windows XP Help 2 19th Sep 2007 08:16 PM
Excel query of Access database - changed database filename, now error ucdcrush@gmail.com Microsoft Excel Discussion 2 8th Mar 2006 08:42 PM
Help: Administrative Rights/Permissions Changed Sam Windows XP Help 2 25th Feb 2006 07:58 AM
User Rights Changed for 'Network Service' in Windows 2003 Sp1? Manfred Senn Microsoft Windows 2000 0 17th Jan 2006 02:12 PM
problem user with admin rights changed to guest account : help! Cuz Tafkatt Windows XP General 1 18th Jan 2004 06:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:48 AM.