|
From: Richard B. <rb...@ar...> - 2004-01-23 05:47:24
|
Hi,
The AtomsFramework now supports BLOBs in databases.
For MSSQL create either a "VarBinary" or an "Image" type column
For MSAccess use an "OLE Object" field
With binary field support you can now save your own encrypted passwords,
pictures of objects, files, or whatever takes your imagination.
Here's an example of how to use it...
Public Class CBinary
Inherits CPersistentObject
....
Dim m_binary() As Byte
....
Public Property BinaryField() As Byte()
Get
Return m_binary
End Get
Set(ByVal Value As Byte())
m_binary = Value
SetDirtyFlag()
End Set
End Property
End Class
Private Sub SomeSub()
Dim cb As CBinary
Dim asciiEnc As New System.Text.ASCIIEncoding
cb = New CBinary
cb.Name = "test"
cb.BinaryField = asciiEnc.GetBytes(cb.Name) 'Convert string to byte array
cb.Save()
cb = New CBinary
cb.Name = "test"
cb.Find(cb)
MsgBox(asciiEnc.GetString(cb.BinaryField)) 'Convert byte array back
to string
End Sub
|