Solved

Problem with loading /sending a blob to oracle

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

786 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