Access 2010 BE and FE's on 1 server - "network" via RDP

Diana van den Berg
4StarLounger
Posts: 582
Joined: 06 May 2012, 20:05

Access 2010 BE and FE's on 1 server - "network" via RDP

Post by Diana van den Berg »

We have got to the testing stage on what was discussed in the thread:

Access 2007 BE and FE's on 1 server - "network" via RDP?

https://www.eileenslounge.com/viewtopic ... 29&t=26422" onclick="window.open(this.href);return false;

namely the Microsoft Access WAN Work-Around .

Firstly I need to say that I previously had Microsoft Office 2007, but now I have Microsoft Office 2010.
I put the BE and the FE in the same folder on the server and Access Runtime 2010 and installed it.

A database that backs up the BE works with no problem, but it isn't split.

I NEED TO RELINK THE BE TO THE FIRST FE ON THE SERVER, BUT:
I can't open the FE with Shift-Click and I can't open the ribbon neither with Ctrl-F! nor the little heart in the top right corner of the screen,

How can I do it? Is there perhaps a shortcut key that will do it - and if so, will it work in the server?

I have found this on

http://allenbrowne.com/ser-13.html" onclick="window.open(this.href);return false;

and it seems to me it would do the trick
- but where would I put it?

Function Reconnect ()
'**************************************************************
'* START YOUR APPLICATION (MACRO: AUTOEXEC) WITH THIS FUNCTION
'* AND THIS PROGRAM WILL CHANGE THE CONNECTIONS AUTOMATICALLY
'* WHEN THE 'DATA.MDB' AND THE 'PRG.MDB'
'* ARE IN THE SAME DIRECTORY!!!
'* PROGRAMMING BY PETER VUKOVIC, Germany
'* 100700.1262@compuserve.com
'* ************************************************************
Dim db As Database, source As String, path As String
Dim dbsource As String, i As Integer, j As Integer

Set db = dbengine.Workspaces(0).Databases(0)
'*************************************************************
'* RECOGNIZE THE PATH *
'*************************************************************

For i = Len(db.name) To 1 Step -1
If Mid(db.name, i, 1) = Chr(92) Then
path = Mid(db.name, 1, i)
'MsgBox (path)
Exit For
End If
Next
'*************************************************************
'* CHANGE THE PATH AND CONNECT AGAIN *
'*************************************************************

For i = 0 To db.tabledefs.count - 1
If db.tabledefs(i).connect <> " " Then
source = Mid(db.tabledefs(i).connect, 11)
'Debug.Print source
For j = Len(source) To 1 Step -1
If Mid(source, j, 1) = Chr(92) Then
dbsource = Mid(source, j + 1, Len(source))
source = Mid(source, 1, j)
If source <> path Then
db.tabledefs(i).connect = ";Database=" + path + dbsource
db.tabledefs(i).RefreshLink
'Debug.Print ";Database=" + path + dbsource
End If
Exit For
End If
Next
End If
Next
End Function

Provided by Peter Vukovic, September 1995.



Thank you for any help.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Access 2010 BE and FE's on 1 server - "network" via RDP

Post by Rudi »

Hi Diana,

Just a quick note to inform that Hans is travelling currently and though he still pops in the back door during this time you may need to wait for other loungers familiar with Access to help answer your query. This one is out of my league.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78620
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Access 2010 BE and FE's on 1 server - "network" via RDP

Post by HansV »

There is no difference between Access 2007 and Access 2010 in this respect. If the code runs on one, it should work on the other too.
Best wishes,
Hans

Diana van den Berg
4StarLounger
Posts: 582
Joined: 06 May 2012, 20:05

Re: Access 2010 BE and FE's on 1 server - "network" via RDP

Post by Diana van den Berg »

Thank you Rudi and Hans for your replies.

Hans, I didn't have this in the 2007 database, but I am relieved, anyway, that there won't be any changes in that regard. The reason why I need it (or something else, if this doesn't work) is that I can't get into the design view in the server to relink the BE to the FE.

My question is:

Where would I put the code - on Alt-F11 (sorry, don't know the correct terminology for that) to test whether it will work or not? I have a feeling that it may need to go somewhere else.

The database is working in the server on the first test FE up to the point of opening the forms and reports.

I have a shortcut on the server with the right logo and it opens up the startup screen and then goes to the main switchboard and when I click on either the Forms or the Reports switchboards they open.

However, when I try to open a form or a report, I get a notification that the (previous) path is invalid, and that is obviously because I haven't relinked (and can't - or at least can't seem to) be able to get to Design View in the server. I have the database running on Access Runtime 2010 (it shows "Empowered by Microsoft Access in the bottom right corner). So, if I can relink the BE to the FE automaically via code, it should work.

I am going to try the above where I think it must go and I will report back here whether it worked or not - I should probably have tried it there anyway first before asking here, because, worst case scenario, if it doesn't work, I can delete it - and in the unlikely case that it messes up the database, I can replace it with another copy of it.

User avatar
HansV
Administrator
Posts: 78620
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Access 2010 BE and FE's on 1 server - "network" via RDP

Post by HansV »

The code should go into a standard module. Create a macro with a single RunCode action that executes Reconnect() and save this macro as AutoExec.
Best wishes,
Hans

Diana van den Berg
4StarLounger
Posts: 582
Joined: 06 May 2012, 20:05

Re: Access 2010 BE and FE's on 1 server - "network" via RDP

Post by Diana van den Berg »

:blush: Blush! Blush!! Blush!!! Blush!!!! BLUSH!!!!!! :bash: :blush:

I need to learn to read!

* START YOUR APPLICATION (MACRO: AUTOEXEC) WITH THIS FUNCTION
'* AND THIS PROGRAM WILL CHANGE THE CONNECTIONS AUTOMATICALLY
'* WHEN THE 'DATA.MDB' AND THE 'PRG.MDB'
'* ARE IN THE SAME DIRECTORY!!!

Sorry, please disregard my previous silly question!

Diana van den Berg
4StarLounger
Posts: 582
Joined: 06 May 2012, 20:05

Re: Access 2010 BE and FE's on 1 server - "network" via RDP

Post by Diana van den Berg »

Thank you, Hans! You must have replied while I was getting all my blushes together in my previous reply!

So that would replace my previous MyRelink() which only worked after it had been relinked a first time.

I am assuming that this code would go before opening my startup screen.

Thank you again. :chocciebar: :thankyou:

Diana van den Berg
4StarLounger
Posts: 582
Joined: 06 May 2012, 20:05

Re: Access 2010 BE and FE's on 1 server - "network" via RDP

Post by Diana van den Berg »

It didn't work, but other problems arose on the server which will affect any further attempts I make with other code or this one edited, until those have been fixed by the network guy. He doesn't work on Saturdays so I will contact him on Monday.