Solved

Open an access table in design mode

Posted on 2004-04-21
9
389 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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
 
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

776 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