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
> Access Speed On Network Folder (be), Access 2010    
 
   
Brepea
post Sep 12 2017, 10:22 AM
Post#1



Posts: 390
Joined: 11-January 09
From: UK


Hi All

I've created an application for a client. The application is super fast and no issues with speed (when on my local pc). I've tested it today on their network folder and it's far too slow - just about makes the application "not fit for purpose".

Setup: Split Database; FE (user's local pc) and the BE on a shared network folder. FE is roughly 14MB and BE is 4MB (so tiny).

My home page has unbound textboxes which extract; User email account: GetSysUserEmail(); System Name: SysName = UserNameGet() & Machine name: Mach = MachineNameGet()

CODE
Function GetSysUserEmail(Optional strCN As String) As String
'Retrieve user's email address from Active Directory
On Error GoTo errHandler
Dim objADInfo As Object
Dim objADUser As Object
Dim strArray() As String
Set objADInfo = CreateObject("ADSystemInfo")
If strCN > "" Then
    strArray = Split(objADInfo.UserName, ",")
    strArray(0) = "CN=" & strCN
    Set objADUser = GetObject("LDAP://" & Join(strArray, ","))
Else
    Set objADUser = GetObject("LDAP://" & objADInfo.UserName)
End If
GetSysUserEmail = objADUser.Mail
errExit:
    Set objADUser = Nothing
    Set objADInfo = Nothing
    Exit Function
    
errHandler:
    MsgBox Err.Number & ": " & Err.Description
    Resume errExit
End Function


CODE
Option Compare Database
Option Explicit

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function apiGetComputerName Lib "kernel32" Alias _
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long


Function UserNameGet() As String
' Outputs network login name
    Dim lngLen As Long, lngX As Long
    Dim strUserName As String
    strUserName = String$(254, 0)
    lngLen = 255
    lngX = apiGetUserName(strUserName, lngLen)
    
    If lngX <> 0 Then
        UserNameGet = Left$(strUserName, lngLen - 1)
    Else
        UserNameGet = ""
    End If
  
    
End Function

Function MachineNameGet() As String

'Outputs computername, which is useful to retain
    Dim lngLen As Long, lngX As Long
    Dim strCompName As String
    lngLen = 16
    strCompName = String$(lngLen, 0)
    lngX = apiGetComputerName(strCompName, lngLen)
    If lngX <> 0 Then
        MachineNameGet = Left$(strCompName, lngLen)
    Else
        MachineNameGet = ""
    End If
End Function



For some reason all of a sudden the system acts as if there is no BE - could that be because i have the user email, machine name and sys name set to unbound textboxes - and perhaps why the system is so slow (is the function constantly looking for which user is logged in)?

Any help with this would be greatly appreciated....i've never had an issue like this before...
Go to the top of the page
 
theDBguy
post Sep 12 2017, 10:32 AM
Post#2


Access Wiki and Forums Moderator
Posts: 70,629
Joined: 19-June 07
From: SunnySandyEggo


Hi,

If you suspect those functions to be causing the problem, can you try to disable them for a minute just to see if it makes any difference?

Just a thought...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
Minty
post Sep 12 2017, 11:24 AM
Post#3



Posts: 16
Joined: 5-July 16



The LDAP queries are really slow - I have a routine that I use to log and allow me to unlock Locked Domain users on my own little DB Developers front end, and a refresh takes almost a minute.
Go to the top of the page
 
theDBguy
post Sep 12 2017, 11:33 AM
Post#4


Access Wiki and Forums Moderator
Posts: 70,629
Joined: 19-June 07
From: SunnySandyEggo


I thought that code looked familiar. It would be appreciated if the "source" credit was left in the code. It's the only compensation we can expect. Thanks.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
Brepea
post Sep 12 2017, 11:41 AM
Post#5



Posts: 390
Joined: 11-January 09
From: UK


Hi - sorry - i only copied the relevant code...

Go to the top of the page
 
theDBguy
post Sep 12 2017, 11:44 AM
Post#6


Access Wiki and Forums Moderator
Posts: 70,629
Joined: 19-June 07
From: SunnySandyEggo


Not a big deal. I am just as happy to see people using the code I'm providing. Cheers!

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
Brepea
post Sep 12 2017, 01:56 PM
Post#7



Posts: 390
Joined: 11-January 09
From: UK


I basically use the procedures to extract the obvious: User name, user email and machine name. These are on load gathered and added to unbound textboxes which my main form's query uses the unbound textbox as a filter to show one staff member's details. Because my query used the unbound textbox I was wondering whether this caused the application to act as if the backend has disappeared... This never happens on local pc, but on network when you first load the main form it takes quite a while to load and all I have on-open is three lines setting those values. Then system loads fine (albeit far too slow), but 5 minutes into it all off a sudden out doesn't know who is logged in- it displays ?Name all over the place.

Go to the top of the page
 
Brepea
post Sep 12 2017, 07:30 PM
Post#8



Posts: 390
Joined: 11-January 09
From: UK


If it helps anyone - and i'm not sure anyone would be as silly as me...took me a long time to pick this up...and it was right in front of me all the time (at least I think this was the issue) - it was about me having linked local Excel spreadsheets in the distributed network copy (.accde). Not sure that actually makes sense because that sits on the user's pc not network - but since i deleted the Excel links it runs much much quicker.

Does that make sense to anyone...?
This post has been edited by Brepea: Sep 12 2017, 07:35 PM
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    19th September 2017 - 12:12 PM