Solved

Problem with loading /sending a blob to oracle

Posted on 2001-07-17
5
419 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 59
TT Auto Dashboard 13 95
I need help embedding an image as HTML in my vb.net application 3 73
adding "ungroup sheets" to existing vbs code 5 29
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

839 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