6
votes

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?

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

1 Answers

0
votes

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