473,385 Members | 1,359 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,385 software developers and data experts.

Forms Hang on Load if no other form with subform is open.

110 100+
This is a really strange issue - when I open my database the only open form is the main switchboard. When I open a search form (which has a subform) it takes about 30 seconds to open. Non-search forms (which also have subforms) take about 5-6 seconds to open. This delay only occurs on the deployment server - there is no delay at all when I open on my laptop.

Now the strange part - if I just keep another form open (on the deployment server) which has a subform on it, the delay goes away. So, to illustrate - if I open frmCustomerSearch with only my switchboard open, it takes 30 seconds to open. If I have any other form open, the delay disappears.

The database is MS 2010 and is split into FE and BE files, both of which are located on the same computer.

As always, any help is greatly appreciated.

Kind Regards,

Gunner
Dec 8 '13 #1

✓ answered by zmbd

As you have found, there is sometimes a downside with using the split database over a lan in that the connection can be slowed. This has to deal with your IT hardware.
One solution, as you discovered, is to open a link to the database and keep it open... that however makes the sharing very difficult.
Some ways around this.

Latebind the form to the recordset... that is to say, in the onload/open event of the form, set the recordsource for the form and remove it from the saved properties. I do this quite often... develop with everything bound and then go in and a late bind. This is really helpful if the number of records is large.

Keep a pointer open to the backend...
Seeing as you have a main switchboard.
In the general section
under declarations
Expand|Select|Wrap|Line Numbers
  1. Static zPointerToDB as DAO.Database
then in the onload of the form you can
Expand|Select|Wrap|Line Numbers
  1. set zPointerToDB = OpenDatabase(zstrName)
  2.  
zstrName is the full path to the backend. You can pull that from the linked tables.

(btw: Once set... use this as your reference in all your RS code! So you wouldn't set a currentdb pointer, you'd just reference this pointer (formname.zpointertodb)
(I'd use something that checked for the object...
Expand|Select|Wrap|Line Numbers
  1. (code ommited)
  2. DIM zLocalDBObj as DAO.Database
  3. (...)
  4. if formname.zpointertodb is nothing then
  5.    set zLocalDBObj = currentdb
  6. else
  7.    set zLocalDBObj = formname.zpointertodb
  8. end if
  9. (...)
  10. if not zLocalDBObj is nothing then set zLocalDBObj = nothing
  11. (...)
)

In your onclose/unload even of the switchboard, you should set the zPointerToDB to nothing to release the link.

Get your IT departement to do an infrastructure upgrade. Since my Dept did that and moved everything to Win7 from WinXP I haven't had any such lags - gota love those 10+Gbit routers :)

11 1237
zmbd
5,501 Expert Mod 4TB
As you have found, there is sometimes a downside with using the split database over a lan in that the connection can be slowed. This has to deal with your IT hardware.
One solution, as you discovered, is to open a link to the database and keep it open... that however makes the sharing very difficult.
Some ways around this.

Latebind the form to the recordset... that is to say, in the onload/open event of the form, set the recordsource for the form and remove it from the saved properties. I do this quite often... develop with everything bound and then go in and a late bind. This is really helpful if the number of records is large.

Keep a pointer open to the backend...
Seeing as you have a main switchboard.
In the general section
under declarations
Expand|Select|Wrap|Line Numbers
  1. Static zPointerToDB as DAO.Database
then in the onload of the form you can
Expand|Select|Wrap|Line Numbers
  1. set zPointerToDB = OpenDatabase(zstrName)
  2.  
zstrName is the full path to the backend. You can pull that from the linked tables.

(btw: Once set... use this as your reference in all your RS code! So you wouldn't set a currentdb pointer, you'd just reference this pointer (formname.zpointertodb)
(I'd use something that checked for the object...
Expand|Select|Wrap|Line Numbers
  1. (code ommited)
  2. DIM zLocalDBObj as DAO.Database
  3. (...)
  4. if formname.zpointertodb is nothing then
  5.    set zLocalDBObj = currentdb
  6. else
  7.    set zLocalDBObj = formname.zpointertodb
  8. end if
  9. (...)
  10. if not zLocalDBObj is nothing then set zLocalDBObj = nothing
  11. (...)
)

In your onclose/unload even of the switchboard, you should set the zPointerToDB to nothing to release the link.

Get your IT departement to do an infrastructure upgrade. Since my Dept did that and moved everything to Win7 from WinXP I haven't had any such lags - gota love those 10+Gbit routers :)
Dec 8 '13 #2
zmbd
5,501 Expert Mod 4TB
oh... and one more thing...
evey user needs a their own copy of the front end.
NEVER have multiple people opening the same front end.
IN FACT, it is preferable to have each user have a local copy of the front end on their PC... there are a lot of ways to automate the relinking of tables (google or seach here on bytes it's been covered many times and there's a ton of code) and there are various methods of deployment.
IN my case, I have a simple series of code that checks which drive the front end is being opened from... if it's anything except a C-Drive path then it asks the user to please close the DB and copy the front end to their local pc desktop.
I've since found some code that write a batch file which I'm trying to get IT to allow to run that will close the db, copy, and the re-open the local copy.
Dec 8 '13 #3
dgunner71
110 100+
Thanks, zmbd - what you have said makes perfect sense. I put the noted code in the main switchboard and the delay is indeed gone now. THANK YOU!

One side note, however - both the front end and back end are on the same computer (not shared across the LAN). Might this delay, however, be a function of an encrypted back end?

In any event, BYTES comes through once again! Thank you!

Gunner
Dec 8 '13 #4
dgunner71
110 100+
zmbd -

Yes - each user will have their own front end - thanks again.

I am deploying this on a server where all users will log in over Remote desktop. Each log in will have a specific front end file associated with a shortcut on their desktop. The reason I do this is first to eliminate the delay and second it makes troubleshooting and updating the front end much easier.

I would appreciate your insight on this approach.

Thanks again,

Gunner
Dec 8 '13 #5
zmbd
5,501 Expert Mod 4TB
I really wouldn't load the front end file from the network each time like that unless you have a very up-to-date infrastructure.

Why?

You have to wait for the front end file to load to the local Access engine
Then you have to wait again as the local, sends to networkFE that then sends to backend, that sends to networkFe, that sends to local...
OK, what actually happens:
Local ACC opens the files on the network.
Local ACC opens the links
User opens form
Local ACC opens form from network... wait for load:
Local ACC sees if there is a record set
Local ACC then calls the linked table information from the network frontend
Local ACC calls the linked table information
Local ACC calls for control information (cbo lists etc)
and so forth...
ALOT OF NETWORK TRAFFIC!

The major advantage of having the local PC have a copy of the frontend file is that NONE of the forms and local tables have to be called over the network.

HOWEVER:
When I go to final alpha, I will do just this...
I split
I load the FE from my network drive
and I push the (colourfull word here) to the limit.
I do this because it is the worst case usage of the infrastructure.... before the 10+Gb routers were installed, there would be horrible time delays and form crashes... now with the faster network... I've been tempted to simply start development with a split database over network.

SO, if you have a good, reliable, highspeed, intranet... go for it... if not... IMHO... not the best way to go.

I use versioning numbers.
In the backend, I have a table that has version number
if the front end opens and the versions for front end and backend do not match (or if the the fe<be v# then new fe req, else id fe>=be# then good to open), then there's a message sent to the user to update and the frontend closed.

There are also various methods to deploy front ends... a search will turn up a few examples. I have a good group of people that all I have to do is tell them in an email and make sure the versions are set and they take care of all this themselves (although I've been asked to automate it :) )
Dec 8 '13 #6
dgunner71
110 100+
zmbd -

I don't think I'm explaining this correctly - the front end and back ends are stored on the server. When a user is going to access the db, they will login to the server over RDP so that they are actually working on the server. When the open the FE, they are opening it and using it on the server. Ultimately, there is very little network traffic (just the display).

The network infrastructure is not great to deploy with the front ends on each user's computer. Also, it makes updating problematic for me.

Back to the original issue - your suggestion has worked well but this only works after the first delay. (The first time I open a form, there is a delay - after this, the delay goes away).

Also - I am not releasing the zPointerToDB (setting to nothing) each time I close the switchboard because I am using it to keep the link open (correct?).

Gunner
Dec 8 '13 #7
dgunner71
110 100+
looks like I spoke too soon - my delay is inexplicably back.
sigh....

Also, having trouble editing forms now because it says that the database is not exclusively open. Back to the drawing board.

Gunner
Dec 8 '13 #8
zmbd
5,501 Expert Mod 4TB
zpointertodb should stay open until you close the application:

1) If the switchboard remains open then the code works
1a) if the switchboard closes at any point pointer closes and you will lose the connection.
-) so, open a second form, hidden, that has the static varible pointed to the backend... you might try this in a standard module too... I usually use the form out of habit.
-) have in the exit application cmdbutton code to close the hidden form, have the hidden form's onclose release the pointer.
\\
Delay... primary suspect is the infrastructure or method of acccess... VPN and RDP are not your friends.

You MUST NOT allow multiple users to open the same front-end which is what it sounds like... otherwise you WILL have conflicts and data corruption.

The network infrastructure is not great to deploy with the front ends on each user's computer. Also, it makes updating problematic for me.
This can be automated... just search... that what I did... the script version looks really promising and I've been working on a multiple access application method.


OK, concerts to attend.
Dec 8 '13 #9
dgunner71
110 100+
zmbd -

Thanks for all your help today - I removed the encryption from my back end. After several hours of testing, I'm relieved to say this seems to have completed eliminated the hang/lag time issue.

Very best.

Gunner
Dec 9 '13 #10
zmbd
5,501 Expert Mod 4TB
yes, general encryption can slow things
You might should take a look at the insight articles covering SHA, MD5, RC4, and AES to at least cover the sensitive data at the individual record level: http://bytes.com/sitemap/f-273.html
Dec 9 '13 #11
dgunner71
110 100+
Will do, zmbd.

Thanks again.

Gunner
Dec 15 '13 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Josh C. | last post by:
Hello everyone. I'm a bit of an Access newbie, so please bear with me. Please go to http://www.dumoti.com/access/ to view the database - 536kb. I'll go straight into examples: In the form...
4
by: Don Seckler | last post by:
I am building an application to track the distribution and returns of copies of magazines. Copies of a magazine that are unsold are returned by the retailer to the wholesaler. They are...
3
by: Simone | last post by:
Hi All, I have a Find Record button setup in most of my forms in order to find a specific customer's details. I have just noticed today though that this search will only find the customer if it...
5
by: ego | last post by:
Hi all , I had created the following Form/SubForm structure : MainForm SubForm A (SubForm of MainForm) SubForm B (SubForm of SubForm A) SubForm C (SubForm of SubForm B) SubForm D ...
1
by: tdmailbox | last post by:
I have the statment below that turns off allow edits so thatwhen I run the commend acCmdFind I only see the find menu rather then find and replace. The search button is on the parent form,...
9
by: PC Datasheet | last post by:
I'm stuck on something that seems should be easy and I need some help. My main form has an option group with five options. My subform chooses from different lists depending on which option is...
3
by: rdemyan via AccessMonster.com | last post by:
My application is split into a front end and back end. Each user has their own copy of the front end. There are a few forms I only want to be open for one user at a time. So I've implemented the...
5
by: Ron | last post by:
Hi All, I've got a form called frmCust that has a subform on it called sfrmBalance. sfrmBalance's control source is a query called qryTrans4CustBal. sfrmBalance has one field on it called...
3
by: Steve | last post by:
Is there a way to put a main form/subform in a continuous form so I can scroll through all the records in the main form? Thanks!
0
sickenhoofer
by: sickenhoofer | last post by:
I am having some problems with a form and its subforms. It was designed to click on a list of numbers on a subform, which causes another subform's data to change to data relevant to the number...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.