Act Blob table

  • Thread starter Thread starter Earl
  • Start date Start date
E

Earl

Anyone know how to get to the details of the blob (.blb) table in Act!6.0?

It appears that all the free tables are simply .dbf files in disguise --
except the .blb.

I can actually open a connection to the table, but when I try to populate
the reader, I'm getting an Odbc exception and a system error.
 
On Wed, 5 May 2004 03:21:47 -0500, "Earl" <brikshoe<at>comcast<.>net> wrote:

¤ Anyone know how to get to the details of the blob (.blb) table in Act!6.0?
¤
¤ It appears that all the free tables are simply .dbf files in disguise --
¤ except the .blb.
¤
¤ I can actually open a connection to the table, but when I try to populate
¤ the reader, I'm getting an Odbc exception and a system error.
¤

You could try the Jet OLEDB driver and dBase ISAM. I'm not sure what kind of data is in your Blob
field (binary? text?) so I don't know what you would save it to. The code would look something like
this:

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\dBase;Extended Properties=dBase IV"
Dim dBaseConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
dBaseConnection.Open()

Dim dBaseCommand As New System.Data.OleDb.OleDbCommand("SELECT * FROM MyDBase",
dBaseConnection)

The following code retrieves binary Blob data (Bitmap) from an Access table. You may be able to
adapt it for dBase:

Sub ReadBlobFromAccess()

Dim DestFilePath As String
Dim RecordId As String
Dim RetVal As Long
Dim FieldLen As Int32

DestFilePath = "e:\My Documents\GreenstoneFromAccess.bmp"
Dim PictureCol As Integer = 0 ' the column # of the BLOB field
Dim AccessConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\db1.mdb")
Dim AccessCommand As New OleDbCommand("SELECT [record ID], OLEField FROM Table1 WHERE
[record id] = 1", AccessConnection)
AccessConnection.Open()
Dim AccessDataReader As OleDbDataReader =
AccessCommand.ExecuteReader(CommandBehavior.SequentialAccess)
AccessDataReader.Read()
FieldLen = AccessDataReader.Item(1).Length
Dim PictureByteArray(FieldLen - 1) As Byte
Dim startIndex As Integer = 0
RetVal = AccessDataReader.GetBytes(1, startIndex, PictureByteArray, 0,
PictureByteArray.Length)
AccessDataReader.Close()
AccessConnection.Close()
Dim FileStreamObject As New System.IO.FileStream(DestFilePath, IO.FileMode.Create,
IO.FileAccess.Write)
FileStreamObject.Write(PictureByteArray, 0, PictureByteArray.Length)
FileStreamObject.Close()

End Sub


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Thanks for the idea Paul. I'm simply trying to read the file, so the
connection string is key. I'm still only able to open all the other .dbfs
but not the blob. Tried to tweak the connection string in various ways and
still no joy. It appears this is some sort of proprietary format, and for
their own reasons I suppose, Best Corp. publishes all the schema -- except
for the blob table.


Paul Clement said:
¤ Anyone know how to get to the details of the blob (.blb) table in Act!6.0?
¤
¤ It appears that all the free tables are simply .dbf files in disguise --
¤ except the .blb.
¤
¤ I can actually open a connection to the table, but when I try to populate
¤ the reader, I'm getting an Odbc exception and a system error.
¤

You could try the Jet OLEDB driver and dBase ISAM. I'm not sure what kind of data is in your Blob
field (binary? text?) so I don't know what you would save it to. The code would look something like
this:

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\dBase;Extended Properties=dBase IV"
Dim dBaseConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
dBaseConnection.Open()

Dim dBaseCommand As New System.Data.OleDb.OleDbCommand("SELECT * FROM MyDBase",
dBaseConnection)

The following code retrieves binary Blob data (Bitmap) from an Access table. You may be able to
adapt it for dBase:

Sub ReadBlobFromAccess()

Dim DestFilePath As String
Dim RecordId As String
Dim RetVal As Long
Dim FieldLen As Int32

DestFilePath = "e:\My Documents\GreenstoneFromAccess.bmp"
Dim PictureCol As Integer = 0 ' the column # of the BLOB field
Dim AccessConnection As New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\db1.mdb")
Dim AccessCommand As New OleDbCommand("SELECT [record ID], OLEField FROM Table1 WHERE
[record id] = 1", AccessConnection)
AccessConnection.Open()
Dim AccessDataReader As OleDbDataReader =
AccessCommand.ExecuteReader(CommandBehavior.SequentialAccess)
AccessDataReader.Read()
FieldLen = AccessDataReader.Item(1).Length
Dim PictureByteArray(FieldLen - 1) As Byte
Dim startIndex As Integer = 0
RetVal = AccessDataReader.GetBytes(1, startIndex, PictureByteArray, 0,
PictureByteArray.Length)
AccessDataReader.Close()
AccessConnection.Close()
Dim FileStreamObject As New System.IO.FileStream(DestFilePath, IO.FileMode.Create,
IO.FileAccess.Write)
FileStreamObject.Write(PictureByteArray, 0, PictureByteArray.Length)
FileStreamObject.Close()

End Sub


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Anyone know how to get to the details of the blob (.blb) table in Act!6.0?

It appears that all the free tables are simply .dbf files in disguise --
except the .blb.

I can actually open a connection to the table, but when I try to populate
the reader, I'm getting an Odbc exception and a system error.

I believe that the best way to access ACT databases is using their OLE
Automation library. It's not terribly pleasant, but it lets you get at
everything.
 
Back
Top