Consulting

Results 1 to 3 of 3

Thread: Sleeper: Working with Oracle CLOB DataType

  1. #1

    Sleeper: Working with Oracle CLOB DataType

    Hi,

    I have a scenario where in i need to connect to Oracle and get data from a table which contains CLOB datatype value. Below is my code:

    Dim ConnectionString As String
    Dim SQL_String As String
    Set con = New ADODB.Connection
    Set recset = New ADODB.Recordset
    Oracle_Data_Source = "perf01"
    Oracle_User = "PERF_OWNER"
    Oracle_Password = "PERF_OWNER"
    ConnectionString = "Provider=msdaora;Data Source=" + Oracle_Data_Source + "; User Id=" + Oracle_User + "; Password=" + Oracle_Password
    con.ConnectionString = ConnectionString
    con.Open con.ConnectionString
    SQL_String = "select ID,dbms_lob.substr(bus_key,25,10) from MDI_WORK"
    recset.Open SQL_String, con, adOpenStatic, adLockReadOnly
    Do While Not recset.EOF
        Debug.Print recset.Fields(0).Value
        Debug.Print recset.Fields(1).Value
     Loop
    When i try to execute this code, getting "Application Defined or Object Defined error '1004'", Pls help me.
    Last edited by Bob Phillips; 05-02-2012 at 12:27 AM. Reason: Added VBA tags

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Greetings,

    Welcome to vbaexpress :-)

    I see that you just joined, please see Here

    As you just joined, I am sure that not providing that you cross-posted here was simply an oversight. Please consider giving the 'answerers' at one site a chance to answer before posting at multiple sites. As Ken explains better than I, it is frustrating to expend time and effort only to find that someone else is attempting a similar vein.

    Mark

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,048
    Location
    Well said GTO
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •