Is there a 1 Megabyte limit on memo fields using the OleDB provider?

I received a question:


My customer is under the impression that there is a size limit (of about 1 meg) on what can be retrieved from a FoxPro Memo field using the OleDb provider? Can someone confirm or refute this???



So I wrote some code that creates a table with a memo field, adds a record, with a 16 Meg string  (See Visual FoxPro System Capacities)

There are many layers of software being used here that might limit the string length:

  • The VFP String variable limit

  • The VFP memo size limit

  • ADO recordset string limit

  • COM string limit



Looking at the Visual FoxPro System Capacities, I see something I wrote years ago!

64 bits = 8 bytes


Largest number = 10 ^ 308 = 2 ^ 1023


-> 10 bits per exponent + 1 for exponent sign plus 1 for number sign => 12 bits


Leaving 52 bits for the mantissa + 1 for implied normalized bit -> 53 bits


LOG10(2^53) = 15.95 decimal digits accuracy







lcCurDir = JustPath(Sys(16))


cd (lcCurDir)



ERASE  testtab1.*

CREATE  TABLE  testtab1 (name c(10),data m)

INSERT INTO testtab1 VALUES ("test",REPLICATE("A",1.6e7))






LOCAL  loRs as adodb.recordset

loConn = CREATEOBJECT('ADODB.Connection')

lcPath = (lcCurDir)

loConn.ConnectionString = "Provider=VFPOLEDB.1;Data Source="+lcPath +";Mode=ReadWrite;Password='';Collating Sequence=MACHINE"


? loConn.Properties('Provider version').value

loRs=loConn.Execute("select * from testtab1")





Comments (1)

  1. The Fox has NO limits!! (ja!)

    One thing is certain, executing "? REPLICATE("A",1.6e7)" at the command window is an agonizing experiment… a reasonable digital equivalent to the ancient Chinese water-drop torture method.

    Not fun!

Skip to main content