Results 1 to 5 of 5
  1. #1
    D_InSub is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    16

    Size of DB


    Hi,

    Have been programming my 1st database, the question is to do with the size of the database.
    I plan to link a lot of .pfd .xml .doc files to this, On computers running SSD and 16GB ram. Using the attachment method at what point would you expect to see the DB become slow.
    I understand that using a hyperlink would be a better method, though the way i want to add files this is a few more hrs programming.
    At what size of you often see your files and where did they get sluggish.

    cheers

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    Attachments can fill up a db fast. Compact regularly.
    But you are in the 1Gig range, you may have to start using links instead of attachments.
    I store the PATH of the file in a field. The code below will allow you to open any file.

    paste this code into a module. Then it will open ANY file via its extension....
    .pdf files will open in acrobat,
    .doc files in word
    etc

    USAGE:
    OpenNativeApp "c:\folder\file.xls"
    'opens in excel
    or
    OpenNativeApp field
    'opens item in field in native app

    Code:
    Option Compare Database
    Option Explicit
    
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    Const SW_SHOWNORMAL = 1
    Const SE_ERR_FNF = 2&
    Const SE_ERR_PNF = 3&
    Const SE_ERR_ACCESSDENIED = 5&
    Const SE_ERR_OOM = 8&
    Const SE_ERR_DLLNOTFOUND = 32&
    Const SE_ERR_SHARE = 26&
    Const SE_ERR_ASSOCINCOMPLETE = 27&
    Const SE_ERR_DDETIMEOUT = 28&
    Const SE_ERR_DDEFAIL = 29&
    Const SE_ERR_DDEBUSY = 30&
    Const SE_ERR_NOASSOC = 31&
    Const ERROR_BAD_FORMAT = 11&
    
    
    Public Sub OpenNativeApp(ByVal psDocName As String)
    Dim r As Long, msg As String
    
    
    r = StartDoc(psDocName)
    If r <= 32 Then
        'There was an error
        Select Case r
            Case SE_ERR_FNF
                msg = "File not found"
            Case SE_ERR_PNF
                msg = "Path not found"
            Case SE_ERR_ACCESSDENIED
                msg = "Access denied"
            Case SE_ERR_OOM
                msg = "Out of memory"
            Case SE_ERR_DLLNOTFOUND
                msg = "DLL not found"
            Case SE_ERR_SHARE
                msg = "A sharing violation occurred"
            Case SE_ERR_ASSOCINCOMPLETE
                msg = "Incomplete or invalid file association"
            Case SE_ERR_DDETIMEOUT
                msg = "DDE Time out"
            Case SE_ERR_DDEFAIL
                msg = "DDE transaction failed"
            Case SE_ERR_DDEBUSY
                msg = "DDE busy"
            Case SE_ERR_NOASSOC
                msg = "No association for file extension"
            Case ERROR_BAD_FORMAT
                msg = "Invalid EXE file or error in EXE image"
            Case Else
                msg = "Unknown error"
        End Select
    '    MsgBox msg
    End If
    End Sub
    
    
    Private Function StartDoc(psDocName As String) As Long
    Dim Scr_hDC As Long
    
    
    Scr_hDC = GetDesktopWindow()
    StartDoc = ShellExecute(Scr_hDC, "Open", psDocName, "", "C:\", SW_SHOWNORMAL)
    End Function

  3. #3
    D_InSub is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    16
    rainman, thanks for that.

    Thought that would be the go, i will use your code posted. great bit of error handling. You dont happen to have a form for user upload and file move to storage location do you, as this would solve the other half.

    cheers again

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    Attached is a sample db that opens on a client. At the bottom is ADD DOC button.
    This would add selected document path to the table and store the doc in a folder (my folder path is in tConfig table)

    ClientSample2.zip

  5. #5
    D_InSub is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    16
    legend thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 10-21-2018, 05:49 PM
  2. Size of Access Window set to Fom size
    By MrDummy in forum Access
    Replies: 2
    Last Post: 06-26-2016, 05:18 AM
  3. Replies: 4
    Last Post: 02-10-2015, 01:07 AM
  4. Replies: 2
    Last Post: 03-20-2013, 04:25 PM
  5. Replies: 3
    Last Post: 07-19-2012, 09:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums