Welcome to MSDN Blogs Sign in | Join | Help

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)

 

CLOSE DATABASES ALL

ERASE  testtab1.*

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

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

?LEN(data),LOG10(LEN(data))

 

CLOSE DATABASES ALL

 

 

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

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

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

?lors.Fields(0).Value

?LEN(lors.Fields(1).Value)

loConn.Close

 

Published Friday, February 10, 2006 10:25 AM by Calvin_Hsia
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

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

Sunday, February 12, 2006 11:26 PM by Kenneth Tamayo
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!

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker