realbasic-nug
[Top] [All Lists]

Re: load image into REALSQLdatabase

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: load image into REALSQLdatabase
From: Marco Bambini <marco at sqlabs dot net>
Date: Sun, 28 May 2006 08:57:34 +0200
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20060528043556 dot 52221 dot qmail at web36810 dot mail dot mud dot yahoo dot com>
This is a very simple example:

// create a dummy table
db.SQLExecute("CREATE TABLE images(picture BLOB)")

// insert an image into the BLOB column
Dim rec As New DatabaseRecord
rec.BlobColumn("picture") = GetMyPicture
db.InsertRecord ("images", rec)
db.Commit

where GetMyPicture is:
Sub GetMyPicture() As String
Dim f As FolderItem = GetFolderItem("myimage.jpg")
Dim s As String
Dim b As BinaryStream

b=f.OpenAsBinaryFile(false)
s=b.Read(b.Length)
b.Close

return s
End Sub

Hope this can help you.
---
Marco Bambini
http://www.sqlabs.net
http://www.sqlabs.net/blog/



On May 28, 2006, at 6:35 AM, Long Huynh wrote:

I look in the example projects downloaded, but could
NOT find an example how to load an image into
REALSQLdatabase table with the field defined as BLOB.

Coud someone send me an example program.

Thanks
_______________________________________________
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>

_______________________________________________
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>


<Prev in Thread] Current Thread [Next in Thread>