Solved

Open an access table in design mode

Posted on 2004-04-21
9
387 Views
Last Modified: 2012-08-13
I have an access database (freeware) which I can add data in using the switchboard manager and I can see the underlying tables with Crystal Reports, but I need to be able to load data directly into the tables using the external import function.


The trouble is I cannot see the tables in design view.  Where do I go to turn this function on?

Cheers
bernard
0
Comment
Question by:BernardGBailey
9 Comments
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 10876843
Hi,

Does anything 'happen' when you use [F11] whilst viewing the Switchboard Manager?

BFN,

fp.
0
 
LVL 16

Expert Comment

by:ahmedbahgat
ID: 10876867
you may try to link to the tablles from another database

cheeds
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 10876905
just out of curiosity, can you list the tables in VBA

e.g. place code in a module and try run it , results placed in intermediate window

Public Sub ListTables()

    Dim i As Integer
   
    On Error Resume Next
   
    Debug.Print "***********************************"
    Debug.Print "LIST OF TABLES/FIELDS"
    Debug.Print "***********************************"
    For i = 0 To CurrentDb.TableDefs.Count - 1
        Debug.Print "Table: " & CurrentDb.TableDefs(i).Name
    Next
   
End Sub
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 10876958
PS.

Assuming the "AllowBypassKey" property has not been set, can you 'access' (ahem) the tables directly if you hold down [SHIFT] whilst double-clicking on the ".mdb" file in Windows Explorer?

BFN,

fp.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 10876972
Sorry, that should've been...

...the "AllowBypassKey" propery has been set...


Interesting article here:

[http://www.mvps.org/access/api/api0068.htm]

"If the AllowBypassKey has not been set, then the 'Shift' key can be programmtically pressed when the database is opened programmatically through Automation code.  To get a reference to a hidden instance of Access with the database in which you wanted to bypass the Autoexec macro, you can use this function."

********* Code Start ***********
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
'
Private Declare Function SetKeyboardState _
    Lib "user32" _
    (lppbKeyState As Any) _
    As Long
   
Private Declare Function GetKeyboardState _
    Lib "user32" (pbKeyState As Any) _
    As Long

Private Declare Function GetWindowThreadProcessId _
    Lib "user32" _
    (ByVal hWnd As Long, _
    lpdwProcessId As Long) _
    As Long

Private Declare Function AttachThreadInput _
    Lib "user32" _
    (ByVal idAttach As Long, _
    ByVal idAttachTo As Long, _
    ByVal fAttach As Long) _
    As Long

Private Declare Function SetForegroundWindow _
    Lib "user32" _
    (ByVal hWnd As Long) _
    As Long

Private Declare Function SetFocusAPI _
    Lib "user32" Alias "SetFocus" _
    (ByVal hWnd As Long) _
    As Long

Private Const VK_SHIFT = &H10
Private Const VK_LSHIFT = &HA0
Private Const VK_RSHIFT = &HA1

Function fGetRefNoAutoexec( _
                        ByVal strMDBPath As String) _
                        As Access.Application
On Error GoTo ErrHandler
Dim objAcc As Access.Application
Dim TIdSrc As Long, TIdDest As Long
Dim abytCodesSrc(0 To 255) As Byte
Dim abytCodesDest(0 To 255) As Byte

    If (Len(Dir$(strMDBPath, vbNormal)) = 0) Then
        Err.Raise 53
    End If

    Set objAcc = New Access.Application
    With objAcc
        .Visible = True

        ' attach to process
        TIdSrc = GetWindowThreadProcessId( _
                            Application.hWndAccessApp, ByVal 0)
        TIdDest = GetWindowThreadProcessId( _
                            .hWndAccessApp, ByVal 0)
               
        If CBool(AttachThreadInput(TIdSrc, TIdDest, True)) Then
            Call SetForegroundWindow(.hWndAccessApp)
            Call SetFocusAPI(.hWndAccessApp)
           
            ' Set Shift state
            Call GetKeyboardState(abytCodesSrc(0))
            Call GetKeyboardState(abytCodesDest(0))
            abytCodesDest(VK_SHIFT) = 128
            Call SetKeyboardState(abytCodesDest(0))
       
            ' Open a mdb with Autoexec
            Call .OpenCurrentDatabase(strMDBPath, False)
           
            ' Revert back keyboard state
            Call SetKeyboardState(abytCodesSrc(0))
        End If
        ' release
        Call AttachThreadInput(TIdSrc, TIdDest, False)
        Call SetForegroundWindow(Application.hWndAccessApp)
        Call SetFocusAPI(Application.hWndAccessApp)
       
    End With
    Set fGetRefNoAutoexec = objAcc
    Set objAcc = Nothing

    Exit Function
ErrHandler:
    If (TIdDest) Then Call AttachThreadInput(TIdSrc, TIdDest, False)
    Call SetForegroundWindow(Application.hWndAccessApp)
    With Err
        .Raise .Number, .Source, .Description, .HelpFile, .HelpContext
    End With
End Function
'********* Code End ***********


BFN,

fp.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10877138
Hmm, although it's freeware, the author might have hidden the tables to protect some of the features.
Why not contact the author directly and/or post the link to the download site here ?

Nic;o)
0
 
LVL 1

Expert Comment

by:jezskill
ID: 10878975
would be handy to see the freeware access db so as to see if the author of the db has limited views and functionality to the user
0
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 125 total points
ID: 11387208
I respectfully suggest the question be closed & points awarded accordingly.

Thank you.
0
 

Author Comment

by:BernardGBailey
ID: 11392921
Whilst I did not use your solution, I was able to open the database with a new version of the code

Cheers
Bernard
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now