Re: ADO, ORACLE and retrieve the value

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dave (dakotav8_at_verizon.net)
Date: 06/10/04


Date: Thu, 10 Jun 2004 09:33:32 -0700

Milly,

I think that the CursorLocation should be adUseServer for this to work.

I use "SELECT MAX("MyIDNumber") AS MyID FROM tblMyTable" as the query. This
will return the last or highest number in the column and works just fine
with any type of database.

This number can be returned by the ADO.Connection.Execute(query).GetString
method. You don't have to use a recordset if your looking for just 1 value.

Dave

"Milly" <Milly@discussions.microsoft.com> wrote in message
news:58C37C79-BDFF-47A1-8043-C5159048D250@microsoft.com...
> Hi all!
>
> I have to find the value of my sequence after the insert in an oracle
database, I'm using ado and vb6:
>
> Set rs = New ADODB.Recordset
> rs.CursorType = adOpenForwardOnly
> rs.CursorLocation = adUseClient
>
> query = "DECLARE Identity NUMBER(11,0):=1; BEGIN INSERT INTO
BC_ONLINE.SysInt_Processo (n_sistemaint, nome_processo,
descrizione_processo, flg_multirec, path_name_frmt_file,
path_name_txt_file, path_name_log_file, flg_Annullato) VALUES ( 1, 'ABI' ,
'prova' , 'N' , yyt' , mmm', ggg' , 'N' ) RETURNING n_Processo INTO Identity
; END;"
>
> rs.Open query
>
> but it doesn't work!!!!
>
> can anyone help me??
>
> thanks!
>
>



Relevant Pages

  • RE: Anyone Please Help!!! I cant figure thi out!!!!!
    ... recSet.CursorLocation = adUseServer ... recSet.CursorType = adOpenKeyset ... > I have a database that contains information that I retrieve through links ... > I have a Parent form that views information from the linked tables via a ...
    (microsoft.public.access.formscoding)
  • Re: MS Access Boolean Fields
    ... I changed the CursorLocation to Server and the CursorType to Keyset. ... My confusion here is that if I edit any other fields on the form (text ... the before edit field values with the field values in the database. ...
    (borland.public.delphi.database.ado)
  • Re: ADO
    ... I have an ODBC Driver for my database. ... ADO to set the is it RecordSource ?? ... 'The code below uses a sample server name, user ID, and password. ... .CursorLocation = adUseServer ...
    (comp.databases.ms-access)
  • Re: Problem with Update via Client Access ODBC/ADO if record contains a negative value
    ... Set cnn = New ADODB.Connection ... .CursorLocation = adUseServer ... Set rec = New ADODB.Recordset ...
    (comp.sys.ibm.as400.misc)
  • Re: sql 2005 / Identitätsspalte
    ... Francesc Hervada-Sala ...
    (microsoft.public.de.access)