Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Table Linking Code Problem

 
   Database Help (Home) -> MS Access RSS
Next:  Bufferpool Issue  
Author Message
Robin

External


Since: Jun 28, 2008
Posts: 35



(Msg. 1) Posted: Wed Dec 10, 2008 9:08 pm
Post subject: Table Linking Code Problem
Archived from groups: microsoft>public>access (more info?)

I have used a bit of code that would check for the links to a BE datatable
and had replaced it recently because it used the commondialog feature which
became problematic when switching to access 2007. I began using Dev Ashish
fRefreshlinks which works fine when users must specify the location each time
the database is opened. Since this is not convenient I have tried to retain
the AreTablesAttached portion of the previous code to determine if the
fRefreshLinks code is needed. But everytime I change the name of the BE,
outside of Access in windows, to test the Must Locate Datatables feature.
The program just starts and immediately closes. Holding the shift button
down does not stop the autoexec feature. I am at a loss for where to check
next. The code testing the links to determine if the fRefrehlinks code is
required is:

Function AreTablesAttached() As Boolean
' Update connection information in attached tables.
'
' Number of attached tables for progress meter.
Const MAXTABLES = 50
Const NONEXISTENT_TABLE = 3011
Const DB_NOT_FOUND = 3024
Const ACCESS_DENIED = 3051
Const READ_ONLY_DATABASE = 3027

Dim intTableCount As Integer
Dim intResponse As Integer
Dim strFileName As String
Dim strAppDir As String
Dim vntReturnValue As Variant
Dim tdf As TableDef
Dim db As Database
Dim rst As Recordset

Dim strFilter As String
Dim strInputFileName As String

Set db = CurrentDb

' AreTablesAttached = True

' Continue if attachments are broken.
On Error Resume Next
' Open attached table to see if connection information is correct.
Set rst = db.OpenRecordset("InsuranceCompany")
' Exit if connection information is correct.
If Err.Number = 0 Then
AreTablesAttached = True
rst.Close
Exit Function
Else
AreTablesAttached = fRefreshLinks()


rst.Close
Exit Function


End If


End Function

and the AutoExec code is:


Function AutoExec()
On Error GoTo AutoExec_Err:

Dim fAnswer As Boolean
Dim dblStartTime As Double
Dim dblTimeElapsed As Double

'Open splash screen form
DoCmd.OpenForm "frmSplash"
DoEvents
'Invoke hourglass
DoCmd.Hourglass True
'Call routine that checks if tables are properly attached
fAnswer = AreTablesAttached()

'Test return value and proceed only if tables were
'successfully attached
If Not fAnswer Then
'fRefreshLinks
MsgBox "You Cannot Run This App Without Locating Data Tables"
DoCmd.Close acForm, "frmSplash"
'DoCmd.Close acForm, "frmGetTables"
Exit Function
End If
'Call GetCompanyInfo
DoCmd.Hourglass False
DoCmd.OpenForm "SwitchBoard"
DoCmd.Maximize
'If splash screen is still loaded, unload it
If IsLoaded("frmSplash") Then
DoCmd.Close acForm, "frmSplash"
End If
Exit Function

AutoExec_Err:
MsgBox "Error # " & Err.Number & ": " & Err.Description
Exit Function
End Function


So the only way to make any tests are to rename the BE back to what was
previously linked. This has me stumped tremendously. Any thoughts would be
appreciated.

Thank you,
Robin

 >> Stay informed about: Table Linking Code Problem 
Back to top
Login to vote
a a r o n _ k e m p f

External


Since: Jun 28, 2008
Posts: 226



(Msg. 2) Posted: Thu Dec 11, 2008 1:06 am
Post subject: Re: Table Linking Code Problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wow-- that's just fantastic

In other words- you think that this whole backend thing is 'too
complex'.
That's funny-- I do also.

I personally choose to use a real database-- like SQL Server for
example-- because i can keep all my tables, queries in one place; and
I can change these while people are using the application.
Meanwhile, you're stuck maintaining obsolete DAO code??!!??

you shoud upsize to SQL Server and stop listening to these dorks
and stop using code off the internet just because some random dude
tells you to





On Dec 10, 9:08 pm, Robin wrote:
> I have used a bit of code that would check for the links to a BE datatable
> and had replaced it recently because it used the commondialog feature which
> became problematic when switching to access 2007.  I began using Dev Ashish
> fRefreshlinks which works fine when users must specify the location each time
> the database is opened.  Since this is not convenient I have tried to retain
> the AreTablesAttached portion of the previous code to determine if the
> fRefreshLinks code is needed.  But everytime I change the name of the BE,
> outside of Access in windows, to test the Must Locate Datatables feature.  
> The program just starts and immediately closes.  Holding the shift button
> down does not stop the autoexec feature.  I am at a loss for where to check
> next.  The code testing the links to determine if the fRefrehlinks code is
> required is:
>
> Function AreTablesAttached() As Boolean
>     '  Update connection information in attached tables.
>     '
>     '  Number of attached tables for progress meter.
>     Const MAXTABLES = 50
>     Const NONEXISTENT_TABLE = 3011
>     Const DB_NOT_FOUND = 3024
>     Const ACCESS_DENIED = 3051
>     Const READ_ONLY_DATABASE = 3027
>
>     Dim intTableCount As Integer
>     Dim intResponse As Integer
>     Dim strFileName As String
>     Dim strAppDir As String
>     Dim vntReturnValue As Variant
>     Dim tdf As TableDef
>     Dim db As Database
>     Dim rst As Recordset
>
>     Dim strFilter As String
>     Dim strInputFileName As String
>
>     Set db = CurrentDb
>
>    ' AreTablesAttached = True
>
>     '  Continue if attachments are broken.
>     On Error Resume Next
>     '  Open attached table to see if connection information is correct.
>     Set rst = db.OpenRecordset("InsuranceCompany")
>     '  Exit if connection information is correct.
>     If Err.Number = 0 Then
>     AreTablesAttached = True
>       rst.Close
>       Exit Function
>     Else
>       AreTablesAttached = fRefreshLinks()
>
>       rst.Close
>       Exit Function
>
>     End If
>
> End Function  
>
> and the AutoExec code is:
>
> Function AutoExec()
>    On Error GoTo AutoExec_Err:
>
>    Dim fAnswer As Boolean
>    Dim dblStartTime As Double
>    Dim dblTimeElapsed As Double
>
>    'Open splash screen form
>    DoCmd.OpenForm "frmSplash"
>    DoEvents
>    'Invoke hourglass
>    DoCmd.Hourglass True
>    'Call routine that checks if tables are properly attached
>    fAnswer = AreTablesAttached()
>
>    'Test return value and proceed only if tables were
>    'successfully attached
>    If Not fAnswer Then
>       'fRefreshLinks
>       MsgBox "You Cannot Run This App Without Locating Data Tables"
>       DoCmd.Close acForm, "frmSplash"
>       'DoCmd.Close acForm, "frmGetTables"
>       Exit Function
>    End If
>    'Call GetCompanyInfo
>    DoCmd.Hourglass False
>    DoCmd.OpenForm "SwitchBoard"
>    DoCmd.Maximize
>    'If splash screen is still loaded, unload it
>    If IsLoaded("frmSplash") Then
>       DoCmd.Close acForm, "frmSplash"
>    End If
>    Exit Function
>
> AutoExec_Err:
>       MsgBox "Error # " & Err.Number & ": " & Err.Description
>       Exit Function
> End Function
>
> So the only way to make any tests are to rename the BE back to what was
> previously linked.  This has me stumped tremendously.  Any thoughts would be
> appreciated.
>
> Thank you,
> Robin

 >> Stay informed about: Table Linking Code Problem 
Back to top
Login to vote
Peter Hibbs

External


Since: Jan 14, 2008
Posts: 137



(Msg. 3) Posted: Thu Dec 11, 2008 5:26 am
Post subject: Re: Table Linking Code Problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Robin,

What I do is create a small text file in the same folder as the FE
which holds the pathname to the BE, the re-link code in the FE file
then uses this to re-establish the links when a new FE is provided.
This means that the relinking is done automatically without the user
having to do anything. You may need to modify it slightly to add your
splash screen code though.

See http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=184
for an example.

HTH

Peter Hibbs.

On Wed, 10 Dec 2008 21:08:01 -0800, Robin
wrote:

>I have used a bit of code that would check for the links to a BE datatable
>and had replaced it recently because it used the commondialog feature which
>became problematic when switching to access 2007. I began using Dev Ashish
>fRefreshlinks which works fine when users must specify the location each time
>the database is opened. Since this is not convenient I have tried to retain
>the AreTablesAttached portion of the previous code to determine if the
>fRefreshLinks code is needed. But everytime I change the name of the BE,
>outside of Access in windows, to test the Must Locate Datatables feature.
>The program just starts and immediately closes. Holding the shift button
>down does not stop the autoexec feature. I am at a loss for where to check
>next. The code testing the links to determine if the fRefrehlinks code is
>required is:
>
>Function AreTablesAttached() As Boolean
> ' Update connection information in attached tables.
> '
> ' Number of attached tables for progress meter.
> Const MAXTABLES = 50
> Const NONEXISTENT_TABLE = 3011
> Const DB_NOT_FOUND = 3024
> Const ACCESS_DENIED = 3051
> Const READ_ONLY_DATABASE = 3027
>
> Dim intTableCount As Integer
> Dim intResponse As Integer
> Dim strFileName As String
> Dim strAppDir As String
> Dim vntReturnValue As Variant
> Dim tdf As TableDef
> Dim db As Database
> Dim rst As Recordset
>
> Dim strFilter As String
> Dim strInputFileName As String
>
> Set db = CurrentDb
>
> ' AreTablesAttached = True
>
> ' Continue if attachments are broken.
> On Error Resume Next
> ' Open attached table to see if connection information is correct.
> Set rst = db.OpenRecordset("InsuranceCompany")
> ' Exit if connection information is correct.
> If Err.Number = 0 Then
> AreTablesAttached = True
> rst.Close
> Exit Function
> Else
> AreTablesAttached = fRefreshLinks()
>
>
> rst.Close
> Exit Function
>
>
> End If
>
>
>End Function
>
>and the AutoExec code is:
>
>
>Function AutoExec()
> On Error GoTo AutoExec_Err:
>
> Dim fAnswer As Boolean
> Dim dblStartTime As Double
> Dim dblTimeElapsed As Double
>
> 'Open splash screen form
> DoCmd.OpenForm "frmSplash"
> DoEvents
> 'Invoke hourglass
> DoCmd.Hourglass True
> 'Call routine that checks if tables are properly attached
> fAnswer = AreTablesAttached()
>
> 'Test return value and proceed only if tables were
> 'successfully attached
> If Not fAnswer Then
> 'fRefreshLinks
> MsgBox "You Cannot Run This App Without Locating Data Tables"
> DoCmd.Close acForm, "frmSplash"
> 'DoCmd.Close acForm, "frmGetTables"
> Exit Function
> End If
> 'Call GetCompanyInfo
> DoCmd.Hourglass False
> DoCmd.OpenForm "SwitchBoard"
> DoCmd.Maximize
> 'If splash screen is still loaded, unload it
> If IsLoaded("frmSplash") Then
> DoCmd.Close acForm, "frmSplash"
> End If
> Exit Function
>
>AutoExec_Err:
> MsgBox "Error # " & Err.Number & ": " & Err.Description
> Exit Function
>End Function
>
>
>So the only way to make any tests are to rename the BE back to what was
>previously linked. This has me stumped tremendously. Any thoughts would be
>appreciated.
>
>Thank you,
>Robin
 >> Stay informed about: Table Linking Code Problem 
Back to top
Login to vote
BruceM

External


Since: Jan 10, 2008
Posts: 350



(Msg. 4) Posted: Thu Dec 11, 2008 7:21 am
Post subject: Re: Table Linking Code Problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

So the OP should listen to one random dude only (you) while ignoring the
rest? Considering that despite your contention DAO is not obsolete, other
information you provide must be regarded with some skepticism.

"a a r o n _ k e m p f" wrote in message

wow-- that's just fantastic

In other words- you think that this whole backend thing is 'too
complex'.
That's funny-- I do also.

I personally choose to use a real database-- like SQL Server for
example-- because i can keep all my tables, queries in one place; and
I can change these while people are using the application.
Meanwhile, you're stuck maintaining obsolete DAO code??!!??

you shoud upsize to SQL Server and stop listening to these dorks
and stop using code off the internet just because some random dude
tells you to





On Dec 10, 9:08 pm, Robin wrote:
> I have used a bit of code that would check for the links to a BE datatable
> and had replaced it recently because it used the commondialog feature
> which
> became problematic when switching to access 2007. I began using Dev Ashish
> fRefreshlinks which works fine when users must specify the location each
> time
> the database is opened. Since this is not convenient I have tried to
> retain
> the AreTablesAttached portion of the previous code to determine if the
> fRefreshLinks code is needed. But everytime I change the name of the BE,
> outside of Access in windows, to test the Must Locate Datatables feature.
> The program just starts and immediately closes. Holding the shift button
> down does not stop the autoexec feature. I am at a loss for where to check
> next. The code testing the links to determine if the fRefrehlinks code is
> required is:
>
> Function AreTablesAttached() As Boolean
> ' Update connection information in attached tables.
> '
> ' Number of attached tables for progress meter.
> Const MAXTABLES = 50
> Const NONEXISTENT_TABLE = 3011
> Const DB_NOT_FOUND = 3024
> Const ACCESS_DENIED = 3051
> Const READ_ONLY_DATABASE = 3027
>
> Dim intTableCount As Integer
> Dim intResponse As Integer
> Dim strFileName As String
> Dim strAppDir As String
> Dim vntReturnValue As Variant
> Dim tdf As TableDef
> Dim db As Database
> Dim rst As Recordset
>
> Dim strFilter As String
> Dim strInputFileName As String
>
> Set db = CurrentDb
>
> ' AreTablesAttached = True
>
> ' Continue if attachments are broken.
> On Error Resume Next
> ' Open attached table to see if connection information is correct.
> Set rst = db.OpenRecordset("InsuranceCompany")
> ' Exit if connection information is correct.
> If Err.Number = 0 Then
> AreTablesAttached = True
> rst.Close
> Exit Function
> Else
> AreTablesAttached = fRefreshLinks()
>
> rst.Close
> Exit Function
>
> End If
>
> End Function
>
> and the AutoExec code is:
>
> Function AutoExec()
> On Error GoTo AutoExec_Err:
>
> Dim fAnswer As Boolean
> Dim dblStartTime As Double
> Dim dblTimeElapsed As Double
>
> 'Open splash screen form
> DoCmd.OpenForm "frmSplash"
> DoEvents
> 'Invoke hourglass
> DoCmd.Hourglass True
> 'Call routine that checks if tables are properly attached
> fAnswer = AreTablesAttached()
>
> 'Test return value and proceed only if tables were
> 'successfully attached
> If Not fAnswer Then
> 'fRefreshLinks
> MsgBox "You Cannot Run This App Without Locating Data Tables"
> DoCmd.Close acForm, "frmSplash"
> 'DoCmd.Close acForm, "frmGetTables"
> Exit Function
> End If
> 'Call GetCompanyInfo
> DoCmd.Hourglass False
> DoCmd.OpenForm "SwitchBoard"
> DoCmd.Maximize
> 'If splash screen is still loaded, unload it
> If IsLoaded("frmSplash") Then
> DoCmd.Close acForm, "frmSplash"
> End If
> Exit Function
>
> AutoExec_Err:
> MsgBox "Error # " & Err.Number & ": " & Err.Description
> Exit Function
> End Function
>
> So the only way to make any tests are to rename the BE back to what was
> previously linked. This has me stumped tremendously. Any thoughts would be
> appreciated.
>
> Thank you,
> Robin
 >> Stay informed about: Table Linking Code Problem 
Back to top
Login to vote
Robin

External


Since: Jun 28, 2008
Posts: 35



(Msg. 5) Posted: Thu Dec 11, 2008 10:14 am
Post subject: Re: Table Linking Code Problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for pointing me in the right direction. I can see that the Checklinks
piece is a better solution than what I currently have. I'll see what luck I
have with the adaptation.

Thank you so much,

Robin



"Peter Hibbs" wrote:

> Robin,
>
> What I do is create a small text file in the same folder as the FE
> which holds the pathname to the BE, the re-link code in the FE file
> then uses this to re-establish the links when a new FE is provided.
> This means that the relinking is done automatically without the user
> having to do anything. You may need to modify it slightly to add your
> splash screen code though.
>
> See http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=184
> for an example.
>
> HTH
>
> Peter Hibbs.
>
> On Wed, 10 Dec 2008 21:08:01 -0800, Robin
> wrote:
>
> >I have used a bit of code that would check for the links to a BE datatable
> >and had replaced it recently because it used the commondialog feature which
> >became problematic when switching to access 2007. I began using Dev Ashish
> >fRefreshlinks which works fine when users must specify the location each time
> >the database is opened. Since this is not convenient I have tried to retain
> >the AreTablesAttached portion of the previous code to determine if the
> >fRefreshLinks code is needed. But everytime I change the name of the BE,
> >outside of Access in windows, to test the Must Locate Datatables feature.
> >The program just starts and immediately closes. Holding the shift button
> >down does not stop the autoexec feature. I am at a loss for where to check
> >next. The code testing the links to determine if the fRefrehlinks code is
> >required is:
> >
> >Function AreTablesAttached() As Boolean
> > ' Update connection information in attached tables.
> > '
> > ' Number of attached tables for progress meter.
> > Const MAXTABLES = 50
> > Const NONEXISTENT_TABLE = 3011
> > Const DB_NOT_FOUND = 3024
> > Const ACCESS_DENIED = 3051
> > Const READ_ONLY_DATABASE = 3027
> >
> > Dim intTableCount As Integer
> > Dim intResponse As Integer
> > Dim strFileName As String
> > Dim strAppDir As String
> > Dim vntReturnValue As Variant
> > Dim tdf As TableDef
> > Dim db As Database
> > Dim rst As Recordset
> >
> > Dim strFilter As String
> > Dim strInputFileName As String
> >
> > Set db = CurrentDb
> >
> > ' AreTablesAttached = True
> >
> > ' Continue if attachments are broken.
> > On Error Resume Next
> > ' Open attached table to see if connection information is correct.
> > Set rst = db.OpenRecordset("InsuranceCompany")
> > ' Exit if connection information is correct.
> > If Err.Number = 0 Then
> > AreTablesAttached = True
> > rst.Close
> > Exit Function
> > Else
> > AreTablesAttached = fRefreshLinks()
> >
> >
> > rst.Close
> > Exit Function
> >
> >
> > End If
> >
> >
> >End Function
> >
> >and the AutoExec code is:
> >
> >
> >Function AutoExec()
> > On Error GoTo AutoExec_Err:
> >
> > Dim fAnswer As Boolean
> > Dim dblStartTime As Double
> > Dim dblTimeElapsed As Double
> >
> > 'Open splash screen form
> > DoCmd.OpenForm "frmSplash"
> > DoEvents
> > 'Invoke hourglass
> > DoCmd.Hourglass True
> > 'Call routine that checks if tables are properly attached
> > fAnswer = AreTablesAttached()
> >
> > 'Test return value and proceed only if tables were
> > 'successfully attached
> > If Not fAnswer Then
> > 'fRefreshLinks
> > MsgBox "You Cannot Run This App Without Locating Data Tables"
> > DoCmd.Close acForm, "frmSplash"
> > 'DoCmd.Close acForm, "frmGetTables"
> > Exit Function
> > End If
> > 'Call GetCompanyInfo
> > DoCmd.Hourglass False
> > DoCmd.OpenForm "SwitchBoard"
> > DoCmd.Maximize
> > 'If splash screen is still loaded, unload it
> > If IsLoaded("frmSplash") Then
> > DoCmd.Close acForm, "frmSplash"
> > End If
> > Exit Function
> >
> >AutoExec_Err:
> > MsgBox "Error # " & Err.Number & ": " & Err.Description
> > Exit Function
> >End Function
> >
> >
> >So the only way to make any tests are to rename the BE back to what was
> >previously linked. This has me stumped tremendously. Any thoughts would be
> >appreciated.
> >
> >Thank you,
> >Robin
>
 >> Stay informed about: Table Linking Code Problem 
Back to top
Login to vote
Robin

External


Since: Jun 28, 2008
Posts: 35



(Msg. 6) Posted: Sat Dec 13, 2008 7:30 am
Post subject: Re: Table Linking Code Problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

While the code that I replaced is more efficient than what I was using
previously. Thank you again.

The real problem was that since I created a custom ribbon in my access 2007
database and had it stored in the Back End datatable. When the BE could not
be found Access failed before the AutoExec code could run. Which is what
created the Front End not to open at all, shift key depressed or otherwise.

Thank you,
Robin

"Robin" wrote:

> Thanks for pointing me in the right direction. I can see that the Checklinks
> piece is a better solution than what I currently have. I'll see what luck I
> have with the adaptation.
>
> Thank you so much,
>
> Robin
>
>
>
> "Peter Hibbs" wrote:
>
> > Robin,
> >
> > What I do is create a small text file in the same folder as the FE
> > which holds the pathname to the BE, the re-link code in the FE file
> > then uses this to re-establish the links when a new FE is provided.
> > This means that the relinking is done automatically without the user
> > having to do anything. You may need to modify it slightly to add your
> > splash screen code though.
> >
> > See http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=184
> > for an example.
> >
> > HTH
> >
> > Peter Hibbs.
> >
> > On Wed, 10 Dec 2008 21:08:01 -0800, Robin
> > wrote:
> >
> > >I have used a bit of code that would check for the links to a BE datatable
> > >and had replaced it recently because it used the commondialog feature which
> > >became problematic when switching to access 2007. I began using Dev Ashish
> > >fRefreshlinks which works fine when users must specify the location each time
> > >the database is opened. Since this is not convenient I have tried to retain
> > >the AreTablesAttached portion of the previous code to determine if the
> > >fRefreshLinks code is needed. But everytime I change the name of the BE,
> > >outside of Access in windows, to test the Must Locate Datatables feature.
> > >The program just starts and immediately closes. Holding the shift button
> > >down does not stop the autoexec feature. I am at a loss for where to check
> > >next. The code testing the links to determine if the fRefrehlinks code is
> > >required is:
> > >
> > >Function AreTablesAttached() As Boolean
> > > ' Update connection information in attached tables.
> > > '
> > > ' Number of attached tables for progress meter.
> > > Const MAXTABLES = 50
> > > Const NONEXISTENT_TABLE = 3011
> > > Const DB_NOT_FOUND = 3024
> > > Const ACCESS_DENIED = 3051
> > > Const READ_ONLY_DATABASE = 3027
> > >
> > > Dim intTableCount As Integer
> > > Dim intResponse As Integer
> > > Dim strFileName As String
> > > Dim strAppDir As String
> > > Dim vntReturnValue As Variant
> > > Dim tdf As TableDef
> > > Dim db As Database
> > > Dim rst As Recordset
> > >
> > > Dim strFilter As String
> > > Dim strInputFileName As String
> > >
> > > Set db = CurrentDb
> > >
> > > ' AreTablesAttached = True
> > >
> > > ' Continue if attachments are broken.
> > > On Error Resume Next
> > > ' Open attached table to see if connection information is correct.
> > > Set rst = db.OpenRecordset("InsuranceCompany")
> > > ' Exit if connection information is correct.
> > > If Err.Number = 0 Then
> > > AreTablesAttached = True
> > > rst.Close
> > > Exit Function
> > > Else
> > > AreTablesAttached = fRefreshLinks()
> > >
> > >
> > > rst.Close
> > > Exit Function
> > >
> > >
> > > End If
> > >
> > >
> > >End Function
> > >
> > >and the AutoExec code is:
> > >
> > >
> > >Function AutoExec()
> > > On Error GoTo AutoExec_Err:
> > >
> > > Dim fAnswer As Boolean
> > > Dim dblStartTime As Double
> > > Dim dblTimeElapsed As Double
> > >
> > > 'Open splash screen form
> > > DoCmd.OpenForm "frmSplash"
> > > DoEvents
> > > 'Invoke hourglass
> > > DoCmd.Hourglass True
> > > 'Call routine that checks if tables are properly attached
> > > fAnswer = AreTablesAttached()
> > >
> > > 'Test return value and proceed only if tables were
> > > 'successfully attached
> > > If Not fAnswer Then
> > > 'fRefreshLinks
> > > MsgBox "You Cannot Run This App Without Locating Data Tables"
> > > DoCmd.Close acForm, "frmSplash"
> > > 'DoCmd.Close acForm, "frmGetTables"
> > > Exit Function
> > > End If
> > > 'Call GetCompanyInfo
> > > DoCmd.Hourglass False
> > > DoCmd.OpenForm "SwitchBoard"
> > > DoCmd.Maximize
> > > 'If splash screen is still loaded, unload it
> > > If IsLoaded("frmSplash") Then
> > > DoCmd.Close acForm, "frmSplash"
> > > End If
> > > Exit Function
> > >
> > >AutoExec_Err:
> > > MsgBox "Error # " & Err.Number & ": " & Err.Description
> > > Exit Function
> > >End Function
> > >
> > >
> > >So the only way to make any tests are to rename the BE back to what was
> > >previously linked. This has me stumped tremendously. Any thoughts would be
> > >appreciated.
> > >
> > >Thank you,
> > >Robin
> >
 >> Stay informed about: Table Linking Code Problem 
Back to top
Login to vote
a a r o n _ k e m p f

External


Since: Jun 28, 2008
Posts: 226



(Msg. 7) Posted: Sun Dec 21, 2008 4:51 pm
Post subject: Re: Table Linking Code Problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Re:
So the OP should listen to one random dude only (you) while ignoring
the
rest? Considering that despite your contention DAO is not obsolete,
other
information you provide must be regarded with some skepticism.

YES, THE OP SHOULD LISTEN TO ME, THE ONLY CERTIFIED IT PROFESSIONAL IN
THIS GROUP





On Dec 11, 4:21 am, "BruceM" wrote:
> So the OP should listen to one random dude only (you) while ignoring the
> rest?  Considering that despite your contention DAO is not obsolete, other
> information you provide must be regarded with some skepticism.
>
> "a a r o n _ k e m p f" wrote in messagenews:15b16b20-6c8e-4b35-8215-86c78221336d@r15g2000prd.googlegroups.com...
> wow-- that's just fantastic
>
> In other words- you think that this whole backend thing is 'too
> complex'.
> That's funny-- I do also.
>
> I personally choose to use a real database-- like SQL Server for
> example-- because i can keep all my tables, queries in one place; and
> I can change these while people are using the application.
> Meanwhile, you're stuck maintaining obsolete DAO code??!!??
>
> you shoud upsize to SQL Server and stop listening to these dorks
> and stop using code off the internet just because some random dude
> tells you to
>
> On Dec 10, 9:08 pm, Robin wrote:
>
>
>
> > I have used a bit of code that would check for the links to a BE datatable
> > and had replaced it recently because it used the commondialog feature
> > which
> > became problematic when switching to access 2007. I began using Dev Ashish
> > fRefreshlinks which works fine when users must specify the location each
> > time
> > the database is opened. Since this is not convenient I have tried to
> > retain
> > the AreTablesAttached portion of the previous code to determine if the
> > fRefreshLinks code is needed. But everytime I change the name of the BE,
> > outside of Access in windows, to test the Must Locate Datatables feature.
> > The program just starts and immediately closes. Holding the shift button
> > down does not stop the autoexec feature. I am at a loss for where to check
> > next. The code testing the links to determine if the fRefrehlinks code is
> > required is:
>
> > Function AreTablesAttached() As Boolean
> > ' Update connection information in attached tables.
> > '
> > ' Number of attached tables for progress meter.
> > Const MAXTABLES = 50
> > Const NONEXISTENT_TABLE = 3011
> > Const DB_NOT_FOUND = 3024
> > Const ACCESS_DENIED = 3051
> > Const READ_ONLY_DATABASE = 3027
>
> > Dim intTableCount As Integer
> > Dim intResponse As Integer
> > Dim strFileName As String
> > Dim strAppDir As String
> > Dim vntReturnValue As Variant
> > Dim tdf As TableDef
> > Dim db As Database
> > Dim rst As Recordset
>
> > Dim strFilter As String
> > Dim strInputFileName As String
>
> > Set db = CurrentDb
>
> > ' AreTablesAttached = True
>
> > ' Continue if attachments are broken.
> > On Error Resume Next
> > ' Open attached table to see if connection information is correct.
> > Set rst = db.OpenRecordset("InsuranceCompany")
> > ' Exit if connection information is correct.
> > If Err.Number = 0 Then
> > AreTablesAttached = True
> > rst.Close
> > Exit Function
> > Else
> > AreTablesAttached = fRefreshLinks()
>
> > rst.Close
> > Exit Function
>
> > End If
>
> > End Function
>
> > and the AutoExec code is:
>
> > Function AutoExec()
> > On Error GoTo AutoExec_Err:
>
> > Dim fAnswer As Boolean
> > Dim dblStartTime As Double
> > Dim dblTimeElapsed As Double
>
> > 'Open splash screen form
> > DoCmd.OpenForm "frmSplash"
> > DoEvents
> > 'Invoke hourglass
> > DoCmd.Hourglass True
> > 'Call routine that checks if tables are properly attached
> > fAnswer = AreTablesAttached()
>
> > 'Test return value and proceed only if tables were
> > 'successfully attached
> > If Not fAnswer Then
> > 'fRefreshLinks
> > MsgBox "You Cannot Run This App Without Locating Data Tables"
> > DoCmd.Close acForm, "frmSplash"
> > 'DoCmd.Close acForm, "frmGetTables"
> > Exit Function
> > End If
> > 'Call GetCompanyInfo
> > DoCmd.Hourglass False
> > DoCmd.OpenForm "SwitchBoard"
> > DoCmd.Maximize
> > 'If splash screen is still loaded, unload it
> > If IsLoaded("frmSplash") Then
> > DoCmd.Close acForm, "frmSplash"
> > End If
> > Exit Function
>
> > AutoExec_Err:
> > MsgBox "Error # " & Err.Number & ": " & Err.Description
> > Exit Function
> > End Function
>
> > So the only way to make any tests are to rename the BE back to what was
> > previously linked. This has me stumped tremendously. Any thoughts would be
> > appreciated.
>
> > Thank you,
> > Robin- Hide quoted text -
>
> - Show quoted text -
 >> Stay informed about: Table Linking Code Problem 
Back to top
Login to vote
BruceM

External


Since: Jan 10, 2008
Posts: 350



(Msg. 8) Posted: Mon Dec 22, 2008 7:30 am
Post subject: Re: Table Linking Code Problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Certified I can believe, but not as an IT Professional.

"a a r o n _ k e m p f" wrote in message

Re:
So the OP should listen to one random dude only (you) while ignoring
the
rest? Considering that despite your contention DAO is not obsolete,
other
information you provide must be regarded with some skepticism.

YES, THE OP SHOULD LISTEN TO ME, THE ONLY CERTIFIED IT PROFESSIONAL IN
THIS GROUP





On Dec 11, 4:21 am, "BruceM" wrote:
> So the OP should listen to one random dude only (you) while ignoring the
> rest? Considering that despite your contention DAO is not obsolete, other
> information you provide must be regarded with some skepticism.
>
> "a a r o n _ k e m p f" wrote in
> messagenews:15b16b20-6c8e-4b35-8215-86c78221336d@r15g2000prd.googlegroups.com...
> wow-- that's just fantastic
>
> In other words- you think that this whole backend thing is 'too
> complex'.
> That's funny-- I do also.
>
> I personally choose to use a real database-- like SQL Server for
> example-- because i can keep all my tables, queries in one place; and
> I can change these while people are using the application.
> Meanwhile, you're stuck maintaining obsolete DAO code??!!??
>
> you shoud upsize to SQL Server and stop listening to these dorks
> and stop using code off the internet just because some random dude
> tells you to
>
> On Dec 10, 9:08 pm, Robin wrote:
>
>
>
> > I have used a bit of code that would check for the links to a BE
> > datatable
> > and had replaced it recently because it used the commondialog feature
> > which
> > became problematic when switching to access 2007. I began using Dev
> > Ashish
> > fRefreshlinks which works fine when users must specify the location each
> > time
> > the database is opened. Since this is not convenient I have tried to
> > retain
> > the AreTablesAttached portion of the previous code to determine if the
> > fRefreshLinks code is needed. But everytime I change the name of the BE,
> > outside of Access in windows, to test the Must Locate Datatables
> > feature.
> > The program just starts and immediately closes. Holding the shift button
> > down does not stop the autoexec feature. I am at a loss for where to
> > check
> > next. The code testing the links to determine if the fRefrehlinks code
> > is
> > required is:
>
> > Function AreTablesAttached() As Boolean
> > ' Update connection information in attached tables.
> > '
> > ' Number of attached tables for progress meter.
> > Const MAXTABLES = 50
> > Const NONEXISTENT_TABLE = 3011
> > Const DB_NOT_FOUND = 3024
> > Const ACCESS_DENIED = 3051
> > Const READ_ONLY_DATABASE = 3027
>
> > Dim intTableCount As Integer
> > Dim intResponse As Integer
> > Dim strFileName As String
> > Dim strAppDir As String
> > Dim vntReturnValue As Variant
> > Dim tdf As TableDef
> > Dim db As Database
> > Dim rst As Recordset
>
> > Dim strFilter As String
> > Dim strInputFileName As String
>
> > Set db = CurrentDb
>
> > ' AreTablesAttached = True
>
> > ' Continue if attachments are broken.
> > On Error Resume Next
> > ' Open attached table to see if connection information is correct.
> > Set rst = db.OpenRecordset("InsuranceCompany")
> > ' Exit if connection information is correct.
> > If Err.Number = 0 Then
> > AreTablesAttached = True
> > rst.Close
> > Exit Function
> > Else
> > AreTablesAttached = fRefreshLinks()
>
> > rst.Close
> > Exit Function
>
> > End If
>
> > End Function
>
> > and the AutoExec code is:
>
> > Function AutoExec()
> > On Error GoTo AutoExec_Err:
>
> > Dim fAnswer As Boolean
> > Dim dblStartTime As Double
> > Dim dblTimeElapsed As Double
>
> > 'Open splash screen form
> > DoCmd.OpenForm "frmSplash"
> > DoEvents
> > 'Invoke hourglass
> > DoCmd.Hourglass True
> > 'Call routine that checks if tables are properly attached
> > fAnswer = AreTablesAttached()
>
> > 'Test return value and proceed only if tables were
> > 'successfully attached
> > If Not fAnswer Then
> > 'fRefreshLinks
> > MsgBox "You Cannot Run This App Without Locating Data Tables"
> > DoCmd.Close acForm, "frmSplash"
> > 'DoCmd.Close acForm, "frmGetTables"
> > Exit Function
> > End If
> > 'Call GetCompanyInfo
> > DoCmd.Hourglass False
> > DoCmd.OpenForm "SwitchBoard"
> > DoCmd.Maximize
> > 'If splash screen is still loaded, unload it
> > If IsLoaded("frmSplash") Then
> > DoCmd.Close acForm, "frmSplash"
> > End If
> > Exit Function
>
> > AutoExec_Err:
> > MsgBox "Error # " & Err.Number & ": " & Err.Description
> > Exit Function
> > End Function
>
> > So the only way to make any tests are to rename the BE back to what was
> > previously linked. This has me stumped tremendously. Any thoughts would
> > be
> > appreciated.
>
> > Thank you,
> > Robin- Hide quoted text -
>
> - Show quoted text -
 >> Stay informed about: Table Linking Code Problem 
Back to top
Login to vote
Robin

External


Since: Jun 28, 2008
Posts: 35



(Msg. 9) Posted: Mon Dec 22, 2008 7:30 am
Post subject: Re: Table Linking Code Problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I am keeping the SQL option available for future use. Right now it would be
difficult to take advice from some one that was unable to answer my question
or help solve my problem. This is probably why most of us use the opinions
posted here.

Robin

"BruceM" wrote:

> Certified I can believe, but not as an IT Professional.
>
> "a a r o n _ k e m p f" wrote in message
>
> Re:
> So the OP should listen to one random dude only (you) while ignoring
> the
> rest? Considering that despite your contention DAO is not obsolete,
> other
> information you provide must be regarded with some skepticism.
>
> YES, THE OP SHOULD LISTEN TO ME, THE ONLY CERTIFIED IT PROFESSIONAL IN
> THIS GROUP
>
>
>
>
>
> On Dec 11, 4:21 am, "BruceM" wrote:
> > So the OP should listen to one random dude only (you) while ignoring the
> > rest? Considering that despite your contention DAO is not obsolete, other
> > information you provide must be regarded with some skepticism.
> >
> > "a a r o n _ k e m p f" wrote in
> > messagenews:15b16b20-6c8e-4b35-8215-86c78221336d@r15g2000prd.googlegroups.com...
> > wow-- that's just fantastic
> >
> > In other words- you think that this whole backend thing is 'too
> > complex'.
> > That's funny-- I do also.
> >
> > I personally choose to use a real database-- like SQL Server for
> > example-- because i can keep all my tables, queries in one place; and
> > I can change these while people are using the application.
> > Meanwhile, you're stuck maintaining obsolete DAO code??!!??
> >
> > you shoud upsize to SQL Server and stop listening to these dorks
> > and stop using code off the internet just because some random dude
> > tells you to
> >
> > On Dec 10, 9:08 pm, Robin wrote:
> >
> >
> >
> > > I have used a bit of code that would check for the links to a BE
> > > datatable
> > > and had replaced it recently because it used the commondialog feature
> > > which
> > > became problematic when switching to access 2007. I began using Dev
> > > Ashish
> > > fRefreshlinks which works fine when users must specify the location each
> > > time
> > > the database is opened. Since this is not convenient I have tried to
> > > retain
> > > the AreTablesAttached portion of the previous code to determine if the
> > > fRefreshLinks code is needed. But everytime I change the name of the BE,
> > > outside of Access in windows, to test the Must Locate Datatables
> > > feature.
> > > The program just starts and immediately closes. Holding the shift button
> > > down does not stop the autoexec feature. I am at a loss for where to
> > > check
> > > next. The code testing the links to determine if the fRefrehlinks code
> > > is
> > > required is:
> >
> > > Function AreTablesAttached() As Boolean
> > > ' Update connection information in attached tables.
> > > '
> > > ' Number of attached tables for progress meter.
> > > Const MAXTABLES = 50
> > > Const NONEXISTENT_TABLE = 3011
> > > Const DB_NOT_FOUND = 3024
> > > Const ACCESS_DENIED = 3051
> > > Const READ_ONLY_DATABASE = 3027
> >
> > > Dim intTableCount As Integer
> > > Dim intResponse As Integer
> > > Dim strFileName As String
> > > Dim strAppDir As String
> > > Dim vntReturnValue As Variant
> > > Dim tdf As TableDef
> > > Dim db As Database
> > > Dim rst As Recordset
> >
> > > Dim strFilter As String
> > > Dim strInputFileName As String
> >
> > > Set db = CurrentDb
> >
> > > ' AreTablesAttached = True
> >
> > > ' Continue if attachments are broken.
> > > On Error Resume Next
> > > ' Open attached table to see if connection information is correct.
> > > Set rst = db.OpenRecordset("InsuranceCompany")
> > > ' Exit if connection information is correct.
> > > If Err.Number = 0 Then
> > > AreTablesAttached = True
> > > rst.Close
> > > Exit Function
> > > Else
> > > AreTablesAttached = fRefreshLinks()
> >
> > > rst.Close
> > > Exit Function
> >
> > > End If
> >
> > > End Function
> >
> > > and the AutoExec code is:
> >
> > > Function AutoExec()
> > > On Error GoTo AutoExec_Err:
> >
> > > Dim fAnswer As Boolean
> > > Dim dblStartTime As Double
> > > Dim dblTimeElapsed As Double
> >
> > > 'Open splash screen form
> > > DoCmd.OpenForm "frmSplash"
> > > DoEvents
> > > 'Invoke hourglass
> > > DoCmd.Hourglass True
> > > 'Call routine that checks if tables are properly attached
> > > fAnswer = AreTablesAttached()
> >
> > > 'Test return value and proceed only if tables were
> > > 'successfully attached
> > > If Not fAnswer Then
> > > 'fRefreshLinks
> > > MsgBox "You Cannot Run This App Without Locating Data Tables"
> > > DoCmd.Close acForm, "frmSplash"
> > > 'DoCmd.Close acForm, "frmGetTables"
> > > Exit Function
> > > End If
> > > 'Call GetCompanyInfo
> > > DoCmd.Hourglass False
> > > DoCmd.OpenForm "SwitchBoard"
> > > DoCmd.Maximize
> > > 'If splash screen is still loaded, unload it
> > > If IsLoaded("frmSplash") Then
> > > DoCmd.Close acForm, "frmSplash"
> > > End If
> > > Exit Function
> >
> > > AutoExec_Err:
> > > MsgBox "Error # " & Err.Number & ": " & Err.Description
> > > Exit Function
> > > End Function
> >
> > > So the only way to make any tests are to rename the BE back to what was
> > > previously linked. This has me stumped tremendously. Any thoughts would
> > > be
> > > appreciated.
> >
> > > Thank you,
> > > Robin- Hide quoted text -
> >
> > - Show quoted text -
>
>
 >> Stay informed about: Table Linking Code Problem 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
problem with Dev Ashish table reconnect code - Hello, I am strugling to get http://www.mvps.org/access/tables/tbl0010.htm code to work in my case. The code runs with the follwing errors: Error #: 3070 The microsoft office access database engine does not recognize 'TableName' as a valid field name or....

Linking to a backend using code? - Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the live databases on the network. Is there a way, via code,..

Linking tables through code - Dear Group, I am trying to create a linked table between two databases. I have: DatabaseA has TableA and DatabaseB has no tables. I would like the sub to be run from DatabaseA that opens DatabaseB and creates a link in DatabaseB to TableA in ..

Indexing problem with Make Table query and Create Index co.. - Hi, No-one replied to this when I sent it last week. Any bites out there today?? ----- My application allows users to create a new back end for separate purposes. It does this by using Make Table Queries and Indexing via SQL. For example ... ..

Linking FE / BE with code using a browsed Path. - I have a Split Database. FE / BE. It has been working fine, on a server for months. The BE exists in a secure folder used by 5 users who have full rights to the application. A number of other users need to use the application just for the purpose of..
   Database Help (Home) -> MS Access All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]