Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems retrieving Word Doc >1 mb using adodb.stream

Status
Not open for further replies.

Dreloch

Programmer
Dec 17, 2003
19
US
I am currently using an adodb.stream to save a word doc to a oracle blob field and retrieve it later using a stream. I have a document that is 1.23 mb in the blob, but when it is streamed back to a file, it get truncated to 1024kb.


This is the code that is used

' Create ADO stream object
Set mStream = New ADODB.Stream

' Set it to a binary file type
mStream.Type = adTypeBinary

' Open it
mStream.Open

Dim CreationDate As Date

' This writes the image from the blob field to the buffer
mStream.Write mRS.Fields("image").Value

' This saves the stream to a file on disk
mStream.SaveToFile tGetAppPath & FileName, adSaveCreateOverWrite

mStream.Close

Set mStream = Nothing

is there some sort of default value that cuts off at 1024 kb?

Both of the pcs used when I get this are using XP. I don't know if that makes a difference. We are using data object 2.7
 
Your code looks good. I use the same exact method for downloading apps upward of 14 megs. So I don't think there is any kind of default size. The only difference between the code you have and the code I have is I "set" my stream in a declaration rather than at run time.

I.e.

Dim mStream As New ADODB.stream

Don't know if that will make a diffence. But this is the only diffence between your code and mine.

hth,
Scoty ::)
 
Is there any way to tell what my buffer size is? When I check mstream.size after the write it is 1024k
 
This is 1 meg. I checked my size after the write but before the save and got 4427308k. I am beginning to believe your problem is not in the download but in your storage (upload) routine.

You may want to post that routine.

hth,
Scoty ::)
 
It looks like this is a driver issue. The data direct driver is stopping sending data after it hits 1 mb
 
The driver company found some documentation that had references to a property that helped us with the problem. We entered "Default Length For Long Data=11000" into the connection string to allow up to 10-11mb . That solved that problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top