Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting Array to an OLE object field in access database

Status
Not open for further replies.

Doicare

Programmer
Jul 17, 2012
2
Hi all

I am facing a problem in storing an array of integers to an OLE object field in the database, I am trying to place an array in a single field, the field data type is OLE Object.

The error I get is "Type Mismatch" at the bold & underline code line listed below.

Kindly advice.


Code:
Sub Import_data()
     
     
     
    Dim oAccesss As New ADODB.Connection
    Dim oRecordset11 As New ADODB.Recordset
    oAccesss.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\DBS.mdb;"
    oRecordset11.Open "Select OLEdata From Table1", oAccesss, adOpenKeyset, adLockOptimistic
     
    Dim SS(10) As integer
     
     
     
    For N = 0 To 9
     
    SS(N) = rnd
    Next N
     
    With oRecordset11
    .Fields.Item(0) = SS
     
    .update
     
    end with
     
    oAccesss.close
    oRecordset11.close
     
    End sub
 
hi,

You might get better results in one of the many MS Access forums like forum705.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
In an OLE Object field you can store an object like a file.
Export vector in a file and then paste it into the field programmatically with AppendChunk () function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top