Hi all - I have an error in an Access app I am trying to develop that I can't seem to solve. Your help would be greatly appreciated.
The application simply pushes up data from a spreadsheet to a temp table in SQL Server (via linked tables in Access). The upload utilizes the DoCmd.TransferSpreadsheet method, which I have used successfully in another project (it is even the same code I am using now).
The issue: During TransferSpreadsheet, the data is being loaded into memory, I can see the progress bar on the bottom of the screen tick up. When it gets about 3/4 of the way full I get an error message saying "Your computer is out of disk space" and asking if I want to append the records. Clicking yes returns Error 3035 "System Resources Exceeded".
File specs:
- Size: 1.62MB
- Rowcount: 13,488
Here is what I have already looked into and implemented with no change in the error:
- Machine has plenty of space left
- Tried multiple machines
- Tried multiple versions of Access (2013 32-bit, 2016 64-bit)
- Tried loading by doing TransferText (using converted csv file)
- Tried repair/compact of the Access app
- Used regedit to add "WorkingSetSleep" to 1 after doing some research
I did try multiple files, and I was able to upload the same file cut down to 7,000 records. So it seems to be the record count that Access is having trouble with. I've done some other research and hit a brick wall. Has anyone hit this error before and solved it? I could break the file apart in code and load a little bit at a time, but would love to avoid that.
The code:
Code:
For Each varFile In .SelectedItems
On Error GoTo CleanFail
'CSV load file to temp db location
'DoCmd.TransferText acImportDelim, , "dbo_Funds4", varFile, True
'EXCEL load file to temp db location
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml, "dbo_Funds4", varFile, True
'add to file count
fileCount = fileCount + 1
'check dailydata table and see if the day already exists
Dim dailyCount As Long
DoCmd.OpenQuery ("qryDailyCheck")
dailyCount = DCount("*", "qryDailyCheck")
DoCmd.Close acQuery, "qryDailyCheck"
'if exists, notify user that data will be overwritten
If dailyCount <> 0 Then
Dim Response
Response = MsgBox("Data for this day already exists, overwrite?", vbYesNo, "Overwrite Data?")
'if user agrees, run query
If Response = 6 Then
SaveDailyData
Else 'user skips
fileCount = fileCount - 1
'delete data from temp table (so it doesn't get added on the next run)
DoCmd.RunSQL ("DELETE FROM dbo_Funds4")
'DoCmd.OpenQuery ("qryDeleteTempData")
End If
Else
'Daily data table has no conflicts, save data
SaveDailyData
End If
'TODO: sql return error reporting
Next
Thanks so much!