1 message in com.mysql.lists.win32blob issue| From | Sent On | Attachments |
|---|---|---|
| Mark Mchugh | 22 Jul 2004 00:51 |
| Subject: | blob issue![]() |
|---|---|
| From: | Mark Mchugh (mark...@yahoo.com) |
| Date: | 07/22/2004 12:51:23 AM |
| List: | com.mysql.lists.win32 |
Hi,
I am writing an application to store documents that i scan into a database. I create adobe pdf files, and i can add them to my database ( mysql ) as a blob.
All of this is fine. But, when i want to read the docs, i have a problem. I am using the following code, and a control from adobe to display the file.
Dim mystream As ADODB.Stream Set mystream = New ADODB.Stream
mystream.Type = adTypeBinary
Set rs = New ADODB.Recordset rs.ActiveConnection = connMySQL sqlstr = "Select * from files WHERE files.file_id = 8" Set rs = New ADODB.Recordset rs.ActiveConnection = connMySQL rs.Open sqlstr, connMySQL, adOpenStatic, adLockOptimistic Debug.Print rs.RecordCount
'rs.Open "Select * from files WHERE files.file_id = 8" mystream.Open mystream.Write rs!File mystream.SaveToFile "c:\test.pdf", adSaveCreateOverWrite mystream.Close rs.Close
'adobe control Pdf1.LoadFile ("c:\text.pdf") Pdf1.Visible = True
the issue here, its that it takes a little bit of time to get the doc from the database, so, the pdf1.loadfile command cannot load the file, as it has not been fully written to the local disk.
i will be running 5 client machines, and one server. is there an easier way to do this?
any advice or code would be very very much appricateed.......
many thanks
__________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail




