'Could not allocate memory' when inserting to a memo field in an MS-Access database with RODBC
Asked Answered
P

1

6

I'm trying to insert a new row to a table in a Microsoft Access database containing a memo field using the sqlSave function in RODBC, and I'm getting the following error:

Calloc' could not allocate memory (1073741824 of 1 bytes) odbcUpdate channel query mydata coldata[m, ] test verbose nastring

By setting verbose = TRUE, the last line I'm getting before the error is:

Binding: 'notes' DataType -1, ColSize 1073741823

It appears it's getting the maximum size of the memo field, which appears to be 1GB, and then trying to allocate that much memory. The insert works fine without changing my code if I change the type of field to 'text' in Access. Is there any way to avoid this behavior, or any alternative way to store more than 255 characters of text in a field?

Pavlodar answered 29/7, 2014 at 22:50 Comment(1)
Looking at the documentation it recomends setting as part of your connection string rows_at_time = 1 cran.r-project.org/web/packages/RODBC/RODBC.pdfEnchorial
D
0

The ODBC connection itself has a buffer size, and by default it's 2048. You may want to expand that for this data set.

Dit answered 14/5, 2018 at 21:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.