Re: Need Help | Rolling out new App. | Trouble with some computers



No, but thanks anyway.

But seriously, if you are running over a wireless, I strongly recommend SQL
Server (get the free Express version) as the back end. I had some serious
corruption problems with a db that was running on a wireless network a while
back. Had a lot of dropped connections and corruption until I moved the
backend to SQL Server. Then, since all the processing is going on on the
server, my speed increased and I stopped having Access corruption problems.

I also would encourage you to rething all of the queries that support your
forms. Bring as little information as possible across the network at any
given time. I've even gone so far as to take a form that was working.
Imbed it as a subform in a larger form that contains nothing but the
subform. Make the query for the main form something like:

SELECT ID FROM yourTable ORDER BY [SomeField]

Then, modify the subforms query so that it points to the [ID] field in the
main form. Something like:

SELECT * FROM yourTable WHERE ID = Forms!MainForm.ID

BTW: I almost never actually say SELECT *

Then, in the Current event of the main form, requery the subform.

This way, your main form, which has navigation buttons on it brings back a
single field (very fast), and the subform (the form with all the data in it)
only brings back a single record.

HTH
Dale

"dch3" <dch3@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D410B0D4-6F44-4DD6-8EDD-00A4A831E9AA@xxxxxxxxxxxxxxxx
So you'd be willing to get up in a Condor and string network cables 30'ft
off
the ground throughout our warehouse? Thanks for the offer - how's Tuesday
after next?

"Dale Fye" wrote:

Yes. That, and speed. Most wireless connections are about 10 times
slower
than their hard-wired counterparts.

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"dch3" wrote:

I assume that your recommendation to go with SQLServer is tied to
assorted
issues related to the front losing the connection to the back end and
the
possiblity of corruption?

"Dale Fye" wrote:

Are they all hard wired, or are the trouble computers running
wireless? If
wireless, I'd strongly recommend moving your backend to SQL Server.

Usually, when I run into this kind of problem, it is a network issue.
At
one point, I had a router/switch/??? which had changed the connection
speed
of my PC to the network. Once that was reset, the application
screamed.
--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"JK" wrote:

I'm in the process of rolling out a new application I developed. It
was built
using Access 2003; it's split; sitting on a network server & I'm
installing
an MDE file on each users computer.

For some reason, it works fine a multiple computers but does not
work on a
couple of computers. They all have Access 2003 installed.

On one computer (the most important computer) when I run the MDE
file - the
application has trouble connecting to the data files. I'm using
some code
from the Access inside out example - I've pasted it below.

It's also not working on another computer - but a different set of
issues.
On this other computer it's jamming up, acting real slow and
sluggish. It's
impossible to use.

But like I said, on most of the computers it works great. It's
lighting
fast. I'm very frustrated and the powers that be want this thing
implimented
ASAP.

Any help or advide you could provide would be greatly appreciated.

Below I've pasted the Load Event, the Timer Event as well as the
Recconect()
function called in the Load Event.

I know this is a lot to look over - thx so much in advance.

JK


Option Compare Database
Option Explicit

Private Sub Form_Load()

Dim varReturn As Variant
Dim blRet As Boolean
Dim lngColor As Long

' Open the standard Windows
' Color Dialog Window.
lngColor = RGB(95, 95, 95) 'aDialogColor(Me.hwnd)
' If user cancel Color DIalog window request WHITE
If lngColor = -1 Then lngColor = RGB(255, 255, 255)
blRet = RestoreMDIBackGroundImage(lngColor)

On Error GoTo Splash1_Error

' Select the database window
DoCmd.SelectObject acForm, "frmSplash", True
' .. and hide it
RunCommand acCmdWindowHide

' Make sure I'm visible
Me.SetFocus

' Save the user's keyboard settings
gintEnterField = Application.GetOption("Behavior Entering
Field")
gintMoveEnter = Application.GetOption("Move After Enter")
gintArrowKey = Application.GetOption("Arrow Key Behavior")

' Now, set up the application keyboard
' Following code just for demonstration - inactive in this
sample
' Application.SetOption "Behavior Entering Field", 1 ' Start of
field
' Application.SetOption "Move After Enter", 1 ' Move to next
field
' Application.SetOption "Arrow Key Behavior", 1 ' Next
character

Splash1_Exit:
Exit Sub

Splash1_Error:
MsgBox "Unexpected error during startup: " & Err & ", " & Error
& vbCrLf
& vbCrLf & _
"Please report this error to your System Administrator.",
vbInformation, gstrAppTitle
ErrorLog Me.Name & "_Splash1", Err, Error
Resume Splash1_Exit

End Sub

Private Sub Form_Timer()

Dim db As DAO.Database, rst As DAO.Recordset
Dim lngAuth As Long, strDept As String, strFirst As String, strLast
As
String, strAuth As String
Dim intDays As Integer

On Error GoTo Splash2_Error

' Turn off the timer
Me.TimerInterval = 0
' Check the linked tables
If ReConnect() Then
' Go on to the next step - have the user "sign on"
DoCmd.OpenForm "frmLogon"
Else
' Something went wrong
' Restore original keyboard behavior
Application.SetOption "Behavior Entering Field",
gintEnterField
Application.SetOption "Move After Enter", gintMoveEnter
Application.SetOption "Arrow Key Behavior", gintArrowKey
' Put the focus back on the database window
DoCmd.SelectObject acTable, "ErrorLog", True
End If

Splash2_Exit:
' All done, close me
DoCmd.Close acForm, Me.Name
Exit Sub

Splash2_Error:
MsgBox "Unexpected error during startup: " & Err & ", " & Error
& vbCrLf
& vbCrLf & _
"Please report this error to your System Administrator.",
vbInformation, gstrAppTitle
ErrorLog Me.Name & "_Splash2", Err, Error
' Put the focus back in the database window
DoCmd.SelectObject acTable, "ErrorLog", True
' and bail
Resume Splash2_Exit

End Sub


'modStartup:


Option Compare Database 'Use database order for string
comparisons
Option Explicit

Public Function AttachAgain(strPath As String) As Integer
' This is a generic function that accepts a new path name
' and attempts to refresh the links of all attached tables
' Input: Path name as C:\SomeFolder\SomeSubFolder
' Output: True if successful
Dim db As DAO.Database, tdf As DAO.TableDef, rst As DAO.Recordset
Dim strFilePath As String, varRet As Variant, intFirst As Integer
Dim intI As Integer, intK As Integer, intL As Integer

' Get a pointer to the database
Set db = CurrentDb
' Initialize the full file path
strFilePath = strPath & "\\Necdc1\deptfolders\Service
db\Version 3\NEC
Data Application_be.mdb"
' Set the "first table" indicator
intFirst = True
' Turn on the progress meter
varRet = SysCmd(acSysCmdInitMeter, "Reconnecting Data...",
db.TableDefs.Count)
' Set an error trap
On Error GoTo Err_Attach
' Attempt to reattach the tables
intI = 0 ' Reset the status meter counter
For Each tdf In db.TableDefs
' Looking for attached tables
If (tdf.Attributes And dbAttachedTable) Then
' Figure out if this is mdb or xls file attached
If InStr(tdf.Connect, ".mdb") <> 0 Then
' Change the Connect property to point to the new
file
tdf.Connect = ";DATABASE=" & strFilePath
' Attempt to refresh the link definition
tdf.RefreshLink
' If the first table, then open a recordset
' to make this go faster
If (intFirst = True) Then
Set rst = db.OpenRecordset(tdf.Name)
intFirst = False
End If
ElseIf InStr(tdf.Connect, ".xls") <> 0 Then
' One of the Excel attached files - find the
DATABASE part
intK = InStr(tdf.Connect, ";DATABASE=")
' Make sure we found it
If intK <> 0 Then
' Now find the file name
intL = InStrRev(tdf.Connect, "\")
' Make sure we found it
If intL <> 0 Then
' Fix the Connect property
tdf.Connect = Left(tdf.Connect, intK + 9) &
strPath
& _
Mid(tdf.Connect, intL)
' Attempt to refresh
tdf.RefreshLink
End If
End If
End If
End If
' Update the status counter
intI = intI + 1
' .. and update the progress meter
varRet = SysCmd(acSysCmdUpdateMeter, intI)
' And pause for a sec so the status bar updates
DoEvents
Next tdf
' Done - clear the progress meter
varRet = SysCmd(acSysCmdClearStatus)
' Clear the object variables
Set tdf = Nothing
rst.Close
Set rst = Nothing
Set db = Nothing
' Return attach successful
AttachAgain = True

Attach_Exit:
Exit Function

Err_Attach:
' Uh, oh - failed. Write a log record
ErrorLog "AttachAgain " & strPath, Err, Error
' Clear the progress meter
varRet = SysCmd(acSysCmdClearStatus)
' Clear the object variables
Set tdf = Nothing
Set db = Nothing
' Return attach failed
AttachAgain = False
' Exit
Resume Attach_Exit

End Function

Public Function CheckConnect() As Integer
' This function is called by frmCopyright after it verifies
' that all library references are OK.

Dim db As DAO.Database, rst As DAO.Recordset, tdf As DAO.TableDef
Dim strFilePath As String, strPath As String
Dim fdgO As FileDialog, varSel As Variant

' Do a test open of a linked table inside an error trap
On Error Resume Next
Set db = CurrentDb
Set rst = db.OpenRecordset("tblContacts", dbOpenDynaset)
' If no error, then close and return true
If Err = 0 Then
rst.Close
' Clear the objects
Set rst = Nothing
Set db = Nothing
' Set OK return
CheckConnect = True
' Done
Exit Function
End If
' Clear the objects
Set rst = Nothing
Set db = Nothing
' Ooops. Got an error - clear it
Err.Clear
' Set a generic error trap from here on
On Error GoTo Attach_Err
' First, try to use the current path of this database
strPath = CurrentProject.path
strFilePath = strPath & "\\Necdc1\deptfolders\Service
db\Version 3\NEC
Data Application_be.mdb"
' Use DIR to see if the data file is here
If Not IsNothing(Dir(strFilePath)) Then
' Call the generic re-attach code
If AttachAgain(strPath) = -1 Then


.