-
VB6 MySQL BLOB
I am trying to post a .jpg file as a BLOB field in a MySQL database.
The following code does not error, but the result is a NULL in the field.
Dim rs As New ADODB.Recordset
Dim mystream As New ADODB.Stream
mystream.Type = adTypeBinary
rs.Open "SELECT Image FROM tblDRSImages WHERE ID = 0", cnCP, adOpenDynamic, adLockOptimistic
rs.AddNew
mystream.Open
mystream.LoadFromFile "F:\dating.jpg"
rs!Image = mystream.Read
rs.Update
rs.Close
mystream.Close
However the next code block works, if I insert an image into the field using TOAD:
rs.Open "SELECT Image FROM tblDRSImages WHERE ID = 5", cnCP
mystream.Open
mystream.Write rs.Fields(0)
mystream.SaveToFile "F:\datingTest.jpg", adSaveCreateOverWrite
rs.Close
mystream.Close
Similar Threads
-
By gdu000 in forum VB Classic
Replies: 0
Last Post: 11-05-2015, 04:40 PM
-
Replies: 0
Last Post: 04-04-2013, 01:20 PM
-
Replies: 12
Last Post: 09-26-2009, 03:46 AM
-
By JochenKlein in forum Java
Replies: 4
Last Post: 06-02-2006, 05:09 AM
-
By Adhem in forum Enterprise
Replies: 0
Last Post: 01-23-2003, 07:01 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|