Giulio

Check out the REAL SQL blog at
http://www.sqlabs.net/realsqlserver/

You will find a thread "A workaround for large INSERT statements" that is about a bug with very large SQL strings.



At 4:56 PM +0100 2/1/07, Giulio wrote:
I have a problem accessing large blob data when several query are performed sequentially

I have on a Real SQL Server a database, with a table 'contracts'

every contract can have a list of pdf files. They are stored in a blob column on another db on the same server.

on the contract form I show the list of pdf files on a listbox, and there is a button 'show' that essentially store the blob data of the selected item on a temporary file and then launches the file to show it with the default reader:

  Dim f As FolderItem
  Dim b As BinaryStream
  dim rs as RecordSet

rs = dbfile.SQLSelect("Select do_documento from documenti where do_id= ..... // selects the blob column form table
  if dbfile.Error then
    MsgBox "Error getting image: " + dbfile.ErrorMessage
    return
  end if
  if rs = nil then
    msgbox "nil"
    return
  end if
  f = TemporaryFolder.Child( filename)
  b = f.CreateBinaryFile("special/any")
  if b = nil then
    msgbox "error creating file"
    return
  end if

  b.Write rs.Field("do_documento").NativeValue
  rs = nil
  b.Close
  f.launch

It works well, if I wait a good delay ( 10 seconds or so ) between each export operation, but if i select another file from the list and click 'show' just after a previous file is shown in the pdf viewer ( just like a user would probably do ),

the recordset returns nil;

the Real SQL Server log shows this error message: checkErrorConditions: wrong protocol signature


if I click again the 'show' button the records return 'nil' again, and finally clicking again I have this error from dbfile.errormessage:

Error getting image: There was an error communicating with the server [sending HEADER]. The server may be down or not responding. and so on. It seems I'm disconnected at this time.

What's happening? is the retrieving of a big blob field synchronous or not? ( it should be, since I read it, store ot on a file and immediately show it with the launch command. what else is happening in asynchronous mode that may affect the subsequent query of blob data? and how can I check where all is finished to perform the next query?

thank you,


    Giulio







_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


--

Cheers,

Dr Gerard Hammond
MacSOS Solutions
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to