dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: How to record to multiple CLOB fields using VB ADO?

  1. #1
    Join Date
    Aug 2009
    Posts
    10

    Angry How to record to multiple CLOB fields using VB ADO?

    I have a program that was attached to an Access 2003 database but now I need to port it to an OracleXE database. I did the whole migration and it is working fine, except for some CLOB fields that are giving me an error.

    I'm using ADO to retrieve/record data to OracleXE but when I try to record some data to one of my tables that has multiple CLOB fields, it gives me a Run-time error like this:

    Run-time error '-2147467259 (80004005)'

    Here's the code I'm using to record to the OraXE table:

    With RS
    .Open ("SELECT * FROM VAGAS"), DBConn, adOpenStatic, adLockOptimistic
    .AddNew
    !consultor = pblCodCon
    !status_vaga = varCodStatVaga
    !detvaga = txtDetVaga.Text
    !qtde_vagas = txtQtdeVagas.Text
    !tipo_vaga = varCodTipoVaga
    !taxa_selecao = txtTXSel.Text
    !ocorrencia = txtOcorrencia.Text
    ...

    The CLOB fields here are !detvaga and !ocorrencia and when it start recording, the 1st CLOB field (detvaga) is recorded but when it reaches the 2nd CLOB (ocorrencia) it gives me that annoiyng run-time error from above.

    Please help!
    Thanks for reading.
    Roger.

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Try running an INSERT query directly into Oracle with the supplied values. Does that work?

  3. #3
    Join Date
    Aug 2009
    Posts
    10
    I've got the answer from another forum but I'll write it here because it might be useful for someone else.

    I was using AdOpenStatic when opening the query before but after changing it to AdOpenKeyset it works!

    I still don't know the difference between them but it worked just fine.

    Anyway, thanks for the support.
    Roger.

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    adOpenStatic: A static snap-shot of the records that match your search criteria are put into the recordset. You can scroll forwards and backwards, and set bookmarks. Changes made to the database by other users however are not visible - all you can see are the records that matched your search at the point in time when the query was executed

    adOpenKeyset: A static snap-shot of the primary key values of the records that match your search criteria are put into the recordset. As you scroll backwards and forwards, the primary key value in the recordset is used to fetch the current data for that record from the database. This cursor thus allows you to see updates to the data made by other users, but it doesn't let you see new records that have been added by other users (because the primary key values for those records are not in your recordset).

Similar Threads

  1. They created J#, why couldn't they do VB#?
    By Thomas Eyde in forum .NET
    Replies: 290
    Last Post: 12-22-2001, 03:13 PM
  2. The day that everything went wrong!!!
    By WHYVB? in forum .NET
    Replies: 0
    Last Post: 10-03-2001, 09:14 AM
  3. Need to reduce network trips and speed up ADO VB code!!
    By Richard Lloyd in forum VB Classic
    Replies: 8
    Last Post: 06-22-2001, 04:52 AM
  4. Replies: 1
    Last Post: 05-23-2001, 09:35 AM
  5. Comparing NULL values (VB, ADO, SQL Server)
    By Heather in forum VB Classic
    Replies: 1
    Last Post: 02-08-2001, 04:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center