Solved

Problem with loading /sending a blob to oracle

Posted on 2001-07-17
5
408 Views
Last Modified: 2008-01-09
Hi All,
I use Oracle 8.1.7 and VB 6 and I want to send and load files from / to the oracle database...

On the line
Set OraSession = CreateObject('OracleInProcServer.XOraSession')

I got an runtimeerror 429
Cannot create Object with ActiveXComponents

Does anybody nows why or a better (easier) way to do this blob...

Special thanks 2u
George

P.S. in the registry on the W95 the OracleInprocServer is registerd!
0
Comment
Question by:geha
5 Comments
 
LVL 4

Expert Comment

by:VincentLawlor
ID: 6288996
Sounds like that the object you are trting to doesn't exist on the machine.

Habe a look for the key OracleInProcServer.XOraSession using regedit. If it's not there then the ActiveX object does not exist or is not registered on the machine.

Vin.
0
 
LVL 3

Accepted Solution

by:
nigelrowe earned 200 total points
ID: 6288999
Personally, I use ADODB to handle Oracle Blobs and Clobs (8.1.6). Here's an example of how (the field txtfield is clob the parameter txt_field is just a string, imgfield is blob image_array is a variant array)....

Private Sub InsertEntryField(ByVal id_entry As Long, ByVal od_field As Variant, ByVal has_children As Variant, ByVal od_father As Variant, ByVal tag_field As Variant, Optional ByVal txt_field As String, Optional ByRef imgage_array As Variant)
On Error GoTo ErrorHandler
Dim Conn As New ADODB.Connection
Dim Rs As ADODB.Recordset
Dim sqlclause As String

    sqlclause = "SELECT identry, odfield, haschildren, odfather, tagfield, txtfield, imgfield FROM entryfield WHERE 1 <> 1"
    Conn.Open Env.GetConnectionString
    Set Rs = New ADODB.Recordset
    Rs.Open sqlclause, Conn, adOpenKeyset, adLockOptimistic
    Rs.AddNew
    Rs.fields("identry").Value = SQLEncode(id_entry)
    Rs.fields("odfield").Value = SQLEncode(od_field)
    Rs.fields("haschildren").Value = SQLEncode(has_children)
    Rs.fields("odfather").Value = SQLEncode(od_father)
    Rs.fields("tagfield").Value = tag_field
    Rs.Update
    If Not IsMissing(txt_field) Then
        Rs.fields("txtfield").AppendChunk txt_field
        Rs.Update
    End If
    If Not IsMissing(imgage_array) Then
        Rs.fields("imgfield").AppendChunk imgage_array
        Rs.Update
    End If
    Rs.Close
    Set Rs = Nothing
    Conn.Close
    Set Conn = Nothing
    Exit Sub
ErrorHandler:
    Abort "InsertEntryField"
    Err.Raise Err.Number, Err.Source, RTErrDescription(TypeName(Me), "InsertEntryField", Err.Description)
End Sub

And heres a sub which calls the above in order to insert a blob....

Public Function Generateptabstract(ByVal a_tag As String, ByVal next_odfield As Integer, ByVal ty_role As Integer, ByVal vb_class As String) As Integer
On Error GoTo ErrorHandler
Dim abstracts As Collection, DocId As String, fname As String
Dim fhandle As Integer, binary_array As Variant, nextod As Integer
    nextod = next_odfield
    Set abstracts = GetDocumentsInCase(CStr(DM_DOCTYPE_PUBLISHEDABSTRACTOPI), CStr(idproc), "", "")
    If abstracts.Count = 0 Then
        Generateptabstract = next_odfield
        Exit Function
    End If
    DocId = abstracts.Item(1).Item(1)
    fname = ViewMainFile(DocId)
   
    fhandle = FreeFile
    Open fname For Binary Access Read As fhandle
    binary_array = InputB(LOF(fhandle), fhandle)
    Close fhandle
   
    InsertEntryField identry, nextod, 0, 0, "<abs>"
    nextod = nextod + 1
    InsertEntryField identry, nextod, 0, 0, a_tag, "binary", binary_array
    nextod = nextod + 1
    InsertEntryField identry, nextod, 0, 0, "</abs>"
    nextod = nextod + 1
   
    Generateptabstract = nextod
    Exit Function
ErrorHandler:
    Generateptabstract = 0
    Abort "Generateptabstract"
    Err.Raise Err.Number, Err.Source, RTErrDescription(TypeName(Me), "Generateptabstract", Err.Description)
End Function
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7153493
Hi geha,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: VincentLawlor@devx and nigelrowe

geha, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Author Comment

by:geha
ID: 7169326
Hi i will split points for eacha answer. thanxs a lot
0
 

Author Comment

by:geha
ID: 7169331
Hi I will split points
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now