Results 1 to 3 of 3
  1. #1
    Join Date
    May 2017

    Unanswered: Trying to understand error 3183

    Attempting to log the file content of a win7 hard drive containing 645GB in 726K of files to 3 related tables; Drives,Paths,Files ... originally wrote a VBA process in Access 2003 but now transferred to Access 2016 ... both versions fail logging at around 640K of files with a 3183 errors sighting exceeded tmp memory.

    The process iterates using FileSystemObjects ... the iteration is by branch level starting with root as level 1 ... each level captures all the files and folders at that level and creates;
    - a Folder and File record for each Folder using DAO recordset
    - a File Record for each File using DAO recordset
    once a level has completed, each folder for that level is then scanned for the next level of files and folders and so on to completion

    Both versions of Access get to level 11 at about 640K of Files+Folders when the error occurs
    - the temp folder pointed to by DOS TEMP PATH is no where at full capacity ... plus all files in the temp folder are less then 1G
    - the mdb file is only 294M no where near a 2G limit for 64bit Win 7 Pro
    - the Create Path and File routines are functions using the same construct with a global set gdbo = currentDB and global recordset objects set as a DAO.recordset
    - i7 Processor with 8G Ram reports msaccess is using 25% of CPU and around 35M of ram ... with 5G a ram free ... 75% idle ... changing priority has no effect on processing
    - attempted to use an INSERT instead of the DAO but can't seem to get the syntax correct using Structure values
    chSQL = "INSERT IN TO Paths (did,pid,ppid,lid,short) Values " _
    & stVal.did & "," _
    & & "," _
    & stVal.ppid & "," _
    & stVal.lid & "," _
    & stVal.short
    CurrentDb.Execute chSQL

    My expectation is by creating Functions for addPath and addFile that Access should flush to disk when the function closes (I know SLOOOOW) but I am not concerned with time at this point ... just looking to determine why this is failing

    Here are the functions and structs I am using for the process:

    Function addPaths(ByRef stVal As stPaths) As Boolean

    On Error GoTo Err_addPaths

    addPaths = True

    Set grp = gdbo.OpenRecordset("Paths", dbOpenDynaset)
    grp!did = stVal.did ' disk ID
    grp!pid = ' path ID
    grp!ppid = stVal.ppid ' parent path ID (root PPID = 0)
    grp!lid = stVal.lid ' path level ID
    grp!short = stVal.short ' short name


    Set grp = Nothing
    Exit Function
    Debug.Print "addPaths "; Err.Number; Err.Description
    addPaths = False
    Resume Exit_addPaths

    End Function

    Function addFiles(ByRef stVal As stFiles) As Boolean

    On Error GoTo Err_addFiles

    addFiles = True

    Set grf = gdbo.OpenRecordset("Files", dbOpenDynaset)

    grf!did = stVal.did ' Disk ID
    grf!pid = ' Path ID
    grf!fid = stVal.fid ' File ID
    grf!attributes = stVal.attributes
    grf!type = stVal.type
    grf!name =
    grf!size = stVal.size
    grf!createdate = stVal.createdate
    grf!lastaccessdate = stVal.lastaccessdate
    grf!lastmodifydate = stVal.lastmodifydate


    Set grf = Nothing
    Exit Function
    Debug.Print "addFiles "; Err.Number; Err.Description
    addFiles = False
    Resume Exit_addFiles

    End Function

    Function getShortPath(inDID As Long, inPPID As Double) As String
    Dim rsp As DAO.Recordset
    Dim inPID As Double
    Dim chShortPath As String

    On Error GoTo Err_getShortPath

    inPID = inPPID

    Set rsp = gdbo.OpenRecordset("Paths", dbOpenDynaset, dbReadOnly)

    rsp.FindFirst "[DID] = " & inDID & " AND [PID] = " & inPID

    If Not rsp.NoMatch Then

    If rsp!ppid <> 0 Then
    chShortPath = getShortPath(inDID, rsp!ppid)
    getShortPath = chShortPath & rsp!short & "\"
    getShortPath = chShortPath & rsp!short
    End Id
    End If


    Set rsp = Nothing
    Exit Function

    Debug.Print "getShortPath "; Err.Number; Err.Description
    getShortPath = ""
    Resume Exit_getShortPath
    End Function

    Type stPaths
    did As Double
    pid As Double
    ppid As Double
    lid As Double
    short As Variant
    End Type

    Type stFiles
    did As Double
    fid As Double
    pid As Double
    attributes As Variant
    type As Variant
    name As Variant
    size As Variant
    createdate As Variant
    lastaccessdate As Variant
    lastmodifydate As Variant
    End Type

  2. #2
    Join Date
    Apr 2014
    Provided Answers: 29
    error 3183 is an OBJECT error. It failed to create the object. The only obj possiblity is the recordset, or TYPE obj.
    I dont see any need for a TYPE object in access. Drop it and use regular types (strings, numbers,dates) to update the recordset.

  3. #3
    Join Date
    May 2017

    error gone with rewrite

    Update ...

    Moved logic from using DAO.Recordset to INSERT INTO (fixed the SQL errors) ... still had the same error after around 640K records

    Decided to modify the logic to use just two tables (a folder is also a file so the Paths table was redundant) plus tossed the path level logic ... instead of iterating at each path level, I allowed the logic to traverse each branch path to completion using re-entrant calls to the same sub ... this sub only uses file objects (dispersed with using structs) to populate the new files table ... the error has disappeared and the time execution has also drastically improved: 20 minutes for 750K files vs 6.5 hrs before crashing to capture 640K files.

    So at this point not sure if the 3183 error had something to do with; Struct vs Table, OR, possibly Struct usage is not releasing memory

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts