UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Peter's Software Table Linker Modifications, Access 2016    
 
   
JAchord
post Feb 25 2020, 09:22 PM
Post#1



Posts: 202
Joined: 11-July 14



I am using peters software table linker. What I would like to do is use it to connect to a local copy of the BE if the network version is not available. I use this DB when I am in the office and everything is fine. When on the road using the VPN it is terrible. The Idea is to copy the BE to my laptop when in the office before traveling then I would have access on the road even if a little outdated.

What would be the best way to set this up to where the DB is read only if it is on the local copy of the BE? No point being able to make changes if it would just corrupt the data to try to reintegrate it to the server copy. I do need to be able to look up records though. I also need to be able to tell if it is using the local or networked copy. I can put a label on each form that says it is a local copy but need an idea of the if statement to use.

Go to the top of the page
 
theDBguy
post Feb 25 2020, 09:24 PM
Post#2


UA Moderator
Posts: 77,736
Joined: 19-June 07
From: SunnySandyEggo


Hi. I would, first, try setting the Read Only attribute of the local copy of the BE hoping that would prevent any changes to it.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
JAchord
post Feb 25 2020, 09:43 PM
Post#3



Posts: 202
Joined: 11-July 14



Do you know of a way to do that programmatically when the VBA code runs to make the copy on the local drive? Right now I have a control that I can hit to copy the files(two backends). Trying to avoid having to go into the local BE and saving it as read only each time I copy it.
Go to the top of the page
 
theDBguy
post Feb 25 2020, 10:05 PM
Post#4


UA Moderator
Posts: 77,736
Joined: 19-June 07
From: SunnySandyEggo


Hi. Just off the top of my head, I quickly thought of using DOS command, which could call using the Shell command. However, you can probably find a VB Script to do the same thing, or use the FileSystem Object. Let me check...

Edit: Here's one link you can check out (it comes with sample code): File Attributes

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
JAchord
post Mar 2 2020, 03:01 PM
Post#5



Posts: 202
Joined: 11-July 14



Thanks DB Guy I got it to work using SetAttr myFile, vbreadonly after the copy command. Now to put a message box to inform myself and others that it is read only. Just need to put a message box in the linker module.
Go to the top of the page
 
JAchord
post Mar 17 2020, 09:05 AM
Post#6



Posts: 202
Joined: 11-July 14



Using SetAttr does not work. Actually having the backend as read only does not work exactly. It causes error messages stating that the db is locked by another user each time a table is accessed. Could probably suppress it but found another way.

I used the following code to set a global variable for connection status. Then i could use that global variable other places to keep stop code from running if local.

CODE
'* Found a backend file, now open it and link to the tables
            'MsgBox strFullPath
            If strFullPath Like "c:\*" Then
                intConnectionStatus = 2
                Call setConnectionStatus(intConnectionStatus)
            Else
                intConnectionStatus = 1
                Call setConnectionStatus(intConnectionStatus)
            End If
Go to the top of the page
 
theDBguy
post Mar 17 2020, 09:20 AM
Post#7


UA Moderator
Posts: 77,736
Joined: 19-June 07
From: SunnySandyEggo


Hi. Thanks for the update.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    8th April 2020 - 05:31 PM