Solved

Problem with loading /sending a blob to oracle

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DIR issue 7 50
Windows 10 start screen issues 9 51
Visual Studio 2005 text editor 10 35
converting visio 2010 to powerpoint 2010  - formatting issues 4 3
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

932 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

10 Experts available now in Live!

Get 1:1 Help Now