473,583 Members | 3,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Don't link to system tables in backend

My front-end code manually links to the backend file.

I was wondering what stops Access from linking to the system tables in the
backend file. Is it just by virtue that they are hidden?

This has recently come up because I've been playing around with converting my
front end to A2003 format. At some point, I had a corruption issue with a
system file MSStorage something. Access kept saying it couldn't find it.
When I looked in the db Window I could see a link to it.

So I ran the code that deletes all links and then restarted my app. At
startup the app recreates all links. That solved the corruption problem.
But it got me thinking about the linking to backend system files.

Should I explicitly include VB Code that prevents linking to system tables
(and maybe other tables that I'm not aware of) contained in the backend.

Thanks.

--
Message posted via http://www.accessmonster.com

Aug 6 '06 #1
13 4896
rdemyan via AccessMonster.c om wrote:
My front-end code manually links to the backend file.

I was wondering what stops Access from linking to the system tables
in the backend file. Is it just by virtue that they are hidden?

This has recently come up because I've been playing around with
converting my front end to A2003 format. At some point, I had a
corruption issue with a system file MSStorage something. Access kept
saying it couldn't find it. When I looked in the db Window I could
see a link to it.

So I ran the code that deletes all links and then restarted my app.
At startup the app recreates all links. That solved the corruption
problem. But it got me thinking about the linking to backend system
files.

Should I explicitly include VB Code that prevents linking to system
tables (and maybe other tables that I'm not aware of) contained in
the backend.

Thanks.
I don't have it handy to check, but I'm pretty sure that the
auto-linking/refreshing code that is frequently recommended in these groups does
have logic to specifically skip the system tables.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Aug 6 '06 #2
I looked at the relinking code on the mvps site and didn't see anything that
popped out at me. I'm only an intermediate level programmer so maybe I
missed it.

So checked the option to show hidden tables and system tables in my backend
file and then launched my front end. I then looked in the dbWindow on my
front end.

I can see the system tables "grayed out". However there are no arrows on the
left hand side indicating that they are linked, except for MSysAccessXML..
However, this system table has showed up as linked in my front end for months.
Even when I delete the link it reappears. It hasn't seemed to cause a
problem, yet.


Rick Brandt wrote:
>My front-end code manually links to the backend file.
[quoted text clipped - 17 lines]
>>
Thanks.

I don't have it handy to check, but I'm pretty sure that the
auto-linking/refreshing code that is frequently recommended in these groups does
have logic to specifically skip the system tables.
--
Message posted via http://www.accessmonster.com

Aug 6 '06 #3
rdemyan via AccessMonster.c om wrote:
I looked at the relinking code on the mvps site and didn't see
anything that popped out at me. I'm only an intermediate level
programmer so maybe I missed it.

So checked the option to show hidden tables and system tables in my
backend file and then launched my front end. I then looked in the
dbWindow on my front end.

I can see the system tables "grayed out". However there are no
arrows on the left hand side indicating that they are linked, except
for MSysAccessXML.. However, this system table has showed up as
linked in my front end for months. Even when I delete the link it
reappears. It hasn't seemed to cause a problem, yet.
Okay I had a look to remind myself how it works. The code loops through and
recreates the links of existing linked tables. Therefore local tables (such as
the system tables) are automatically skipped.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Aug 6 '06 #4
Okay I had a look to remind myself how it works. The code loops through and
recreates the links of existing linked tables. Therefore local tables (such as
the system tables) are automatically skipped.
How did it get linked then?

Aug 6 '06 #5
"Lyle Fairfield" <ly***********@ aim.comwrote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
>Okay I had a look to remind myself how it works. The code loops through and
recreates the links of existing linked tables. Therefore local tables (such
as
the system tables) are automatically skipped.

How did it get linked then?
How did what get linked? His system table? I have no idea. I don't know if we
have even established that he is using the same code. The code I use loops
through existing links skipping ODBC links. I'm not positive that it's based on
the code at the MVPS.Org site, but that is my recollection.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Aug 6 '06 #6
Rick Brandt wrote:
"Lyle Fairfield" <ly***********@ aim.comwrote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
Okay I had a look to remind myself how it works. The code loops through and
recreates the links of existing linked tables. Therefore local tables (such
as
the system tables) are automatically skipped.
How did it get linked then?

How did what get linked? His system table? I have no idea.
In another thread he identified the linked table as MSysAccessStora ge.

In Access 2003 (I believe the OP is using Access 2003) when I try to
link to MSysAccessStora ge in another db, the linked table is named
MSysAccessStora ge1 by default. I haven't been able to rename it to
MSysAccessStora ge.

Aug 6 '06 #7
This damned MSysAccessStora ge table keeps getting linked to my front end. I
don't know why. It's the only system table that keeps getting linked. I
delete it and then my code seems to be relinking it but no other system
tables.

Oh, and it's currently only happening with my app on one computer but not on
my other computer. Exact same front end??!

This file is causing an error to occur on startup.

Lyle Fairfield wrote:
>Okay I had a look to remind myself how it works. The code loops through and
recreates the links of existing linked tables. Therefore local tables (such
[quoted text clipped - 4 lines]
>>
How did what get linked? His system table? I have no idea.

In another thread he identified the linked table as MSysAccessStora ge.

In Access 2003 (I believe the OP is using Access 2003) when I try to
link to MSysAccessStora ge in another db, the linked table is named
MSysAccessStor age1 by default. I haven't been able to rename it to
MSysAccessStor age.
--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200608/1

Aug 7 '06 #8
"rdemyan via AccessMonster.c om" <u6836@uwewro te in
news:6463ce9f7f 344@uwe:
This damned MSysAccessStora ge table keeps getting linked to my front
end. I don't know why. It's the only system table that keeps getting
linked. I delete it and then my code seems to be relinking it but no
other system tables.
and your code is?

--
Lyle Fairfield
Aug 7 '06 #9
A couple of notes:
1) I use a global error handler
2) My backends have all permissions removed so I use RWOP queries in the
front end.
3) I'm a beginning/intermediate programmer, so be gentle :)

Okay, here it is

Public Function RelinkToCurDir( PassedBEFile As String, FullPathProvide d As
Boolean) As Boolean
'Note, when all permissions have been removed from the backend tables
'and with RWOP, relinking will cause an error and the code must use Resume
'Next. This is by design from Microsoft. When the error is ignored,
'then the relinking will work.
'3/22/2006 NOTE: Must use On Error Resume Next at the top of the code.
Trapping
'the error in an error handler and then using Resume Next does not work.
'THIS IS EXTREMELY IMPORTANT

On Error GoTo Err_Ctrl

Dim wsBACK As DAO.Workspace
Dim dbBACK As DAO.Database
Dim BEFile As String

Dim stDocName As String
Dim db As Database
Dim tdf As TableDef
Dim X As Boolean, TableToLink As String
BEFile = PassedBEFile
'NOTE: 3/25/2006: dbBACK needs to be included. If only db is used, then all
links are included
'(about 150) and are deleted each time as each backend file is linked. By
using dbBACK, we
'get the count of the tables from the backend file.

Set wsBACK = DBEngine.Worksp aces(0)
Set dbBACK = wsBACK.OpenData base(BEFile)
Set db = CurrentDb()

On Error Resume Next

'Now link the tables
For k = dbBACK.TableDef s.Count - 1 To 0 Step -1

TableToLink = dbBACK.TableDef s(k).Name

'Delete the link if it already exists.
'Using the .Connect statement assures that only linked
'tables get deleted and not any front end tables

If fIsRemoteTable( TableToLink) Then
db.TableDefs.De lete TableToLink

Else
'Don't delete any front-end tables
'and Don't delete links that don't exist

End If

'Create the new link
Set tdf = db.CreateTableD ef(TableToLink)

'Set the properties of the new link
'and append to the tabledefs collection
tdf.SourceTable Name = TableToLink
tdf.Connect = ";DATABASE= " & BEFile
db.TableDefs.Ap pend tdf

Next k

RelinkToCurDir = True
Exit_Function: On Error Resume Next

Set db = Nothing
Set dbBACK = Nothing
Set tdf = Nothing

Exit Function
Err_Ctrl:

'This is the error where the backend can't be found. This will cause a loop
error if not
'trapped here that takes about 30 to 50 cancels to stop.
If Err.Number = 3024 Then
Resume Exit_Function
ElseIf Err.Number = 3078 Then
Resume Exit_Function
End If

DoCmd.Hourglass False
errMsgStr = ""
ctrlfnctnm = "RelinkToCurDir "
Call StartupModule_e rr(Err.Number, Err.DESCRIPTION , Err.Source,
ctrlfnctnm, errMsgStr)
Resume Exit_Function
End Function

+++++++++++++++ +++++++++++++++ +++++++++++++++ +++++++++++++++ +++++++++++++++ +++++++

Function fIsRemoteTable( strTbl As String) As Boolean

'Checks if a table is a linked table or this database table

Dim wsLOCAL As DAO.Workspace, dbLOCAL As DAO.Database, rsLOCAL As DAO.
Recordset
Dim rsLOCALFlag As Boolean
Dim strSQLLOCAL As String

On Error GoTo Exit_Sub

strSQLLOCAL = "SELECT Name FROM MSysObjects WHERE Type = 6 AND Name = '" &
strTbl & "';"
Set wsLOCAL = DBEngine.Worksp aces(0)
Set dbLOCAL = wsLOCAL.OpenDat abase(CurrentPr oject.FullName)
Set rsLOCAL = dbLOCAL.OpenRec ordset(strSQLLO CAL, dbOpenDynaset, dbSeeChanges)
rsLOCALFlag = True

If rsLOCAL.RecordC ount = 0 Then
'Local Table or doesn't exist in table
fIsRemoteTable = False
Else
'Remote table
fIsRemoteTable = True
End If

Exit_Sub: On Error Resume Next

If rsLOCALFlag = True Then
rsLOCAL.Close
Set rsLOCAL = Nothing
dbLOCAL.Close
Set dbLOCAL = Nothing
Set wsLOCAL = Nothing
rsLOCALFlag = False
End If
DoCmd.SetWarnin gs True
Exit Function

Err_Ctrl:

DoCmd.Hourglass False

If Err.Number = 3265 Then
fIsRemoteTable = False
Resume Exit_Sub
End If

errMsgStr = ""
ctrlfnctnm = "fIsRemoteTable "
Call StartupModule_e rr(Err.Number, Err.DESCRIPTION , Err.Source,
ctrlfnctnm, errMsgStr)
Resume Exit_Sub
End Function


Lyle Fairfield wrote:
>This damned MSysAccessStora ge table keeps getting linked to my front
end. I don't know why. It's the only system table that keeps getting
linked. I delete it and then my code seems to be relinking it but no
other system tables.

and your code is?
--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200608/1

Aug 7 '06 #10

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

Similar topics

2
2270
by: Michael, | last post by:
I dont want to see these at all and cannot find where to specify a view or modification of a view. can someone throw me a bone here and tell me where to make the adjustments if I can make them at all Michael
4
2304
by: Kevin Haugen | last post by:
SQL SERVER 2000 System let's you alter the system tables and add indexes. However, it won't let you drop the index afterward. Anybody know how to drop an index on a system table? Thanks, Kevin
2
3643
by: T Chaudhary | last post by:
Hi, I want to replicate the system tables of the Northwind database in another test database that I have created (say NorthwindTest). I started with the syscomments table: insert into NorthwindTest.dbo.syscomments select * from Northwind..syscomments where Northwind..syscomments.id not in
4
2452
by: serge | last post by:
I tried all the INFORMATION_SCHEMA on SQL 2000 and I see that the system tables hold pretty much everything I am interested in: Objects names (columns, functions, stored procedures, ...) stored procedure statements in syscomments table. My questions are: If you script your whole database everything you end up having in the text sql...
9
2337
by: Vassago | last post by:
Hi! I need to recreate the system tables (sysobjects, syscolumns, sysindexes, sysforeignkeys, sysconstraints, sysreferences, sysindexkeys at least) in another SQL server. You may say "Thats easy! Backup and restore the database!" and I would answer "I can't, the database size is above 50GB and I just can't do it every time I need to recreate...
4
1604
by: Boris Popov | last post by:
Hello pgsql-general, When trying to create a table CREATE TABLE sessions ( id serial PRIMARY KEY, procpid int4 REFERENCES pg_listener(listenerpid) ON DELETE CASCADE ); I get a warning saying 'relation "pg_listener" is a system catalog'
1
2182
by: pemigh | last post by:
I'm almost done with an application, and trying to lock it down tightly. But I still want users to be able to point to a new location for the data file. The code below fires off to detect and address the problem of a moved/renamed data file. The problem: WITHOUT the "tdf.Attributes = dbHiddenObject" line, my previously hidden tables are...
1
2263
by: TGEAR | last post by:
I am using MS SQL Server management studio. I treid to see some system tables which are sysobjects, syscolumns, systypes, etc.., but i don't see the list under the system tables folder. There is one table showing, sysdiagrams; however, I was able to query sql stmts though. where are they located? or Do I need to contact a dba to release those...
8
3033
by: Neil | last post by:
I just started using Access 2003, and I can't link a SQL Server table. I right-click on the database window; select Link Tables; and select ODBC Databases from the Files of Type dropdown. As soon as I select ODBC Databases from the Files of Type dropdown, the entire dialog box disappears. No error message. Just disappears, and I'm back at the...
0
7895
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...
0
8327
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7935
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...
0
8193
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5701
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...
0
5374
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...
0
3843
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2333
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
0
1157
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...

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.