I've had a similar problem before. My workaround was to read the image into a string, 
then escape the string (replace ' with \' etc). Then use an INSERT statement to put it 
in the database. That works fine wih any sized image. 

Stephan.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 14 August 2002 12:50
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: Problem with BLOB Field 


I would be suspicious that the problem is with ADO or the underlying COM
technology. The maximum size of a string in VB is 64K. Perhaps the largest
field size ADO can pass back is similarly limited?

John Bonnett

-----Original Message-----
From: deep kapasi [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 13 August 2002 10:03 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Problem with BLOB Field 


Hi,

I have already posted this query 4-5 days ago but no
reply yet so posting 2nd time.

Here is the query.

Application Used: Visual Basic 6
Database: MySQL 4.0.2
ODBC: MyODBC 3.51.03

I have create a table which has BLOB field in which i
want to save a bitmap file.

To save record i create a ADO recordset for that table
and after that update that field with binary data of
image file, but problem is that though field is of
BLOB datatype ADO recordset say its size is only 64K
so if i try to save file larger than 64K it truncates
remaining data.

Following is the table structure and vbcode i use
----------------------------------------------------
MySQL Tables -->
create table attachment
(
attachmentid int auto_increment not null primary key,
attachmentname varchar(200),
attachment longblob
)type=innodb;


VBCode -->
Dim cnn as New ADODB.Connection
Dim rst as New ADODB.Recordset

cnn.open "Driver={MySQL ODBC 3.51
Driver};SERVER=localhost;DB=test;UID=root;PWD=pwd;OPTION=35"

With rst
 Set .ActiveConnection = cnn
 .CursorLocation = adUseClient
 .CursorType = adOpenKeyset
 .LockType = adLockPessimistic
 .Open _
  Source:="SELECT * FROM
Attachment",Options:=adCmdText
End With
Debug.print rst.fields("Attachment").DefinedSize 

------------------------------------------------------

Any Help/Suggestion is appreciated.

Waiting for help/suggestion.


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to