| re: Accessing Oracle Sequences via ODBC
"berj" <berj@adelphia.net> wrote in message
news:jPCdnf1TnrowcX3cRVn-qA@adelphia.com...[color=blue]
> It would be of great help if you could provide the sample code.
>
> Thanks![/color]
Here a few variations:
I use a public function to check the connection to Oracle (cn), re-establish
it if necessary.
Connect_Oracle
' A "quick and dirty" way to get the next value:
DIM NewActivityID as String
NewActivityID = cn.Execute( _
"SELECT ESS.S_10_1_Activities_TBL.NEXTVAL FROM DUAL").GetString
' Or, using a record set:
DIM NewEvent as Long
rs.Open "SELECT ESS.S_19_1_OnSiteDetails_TBL.NEXTVAL from Dual", cn
NewEvent = rs(0)
rs.Close
' A slight variation
DIM Nval as Long
SQL = "select ESS.Concurrence_Seq.NEXTVAL from dual"
rs.Open SQL, cn
Nval = rs(0)
rs.Close
Hope this helps,
Randy
[color=blue]
> "Randy Harris" <randy@SpamFree.com> wrote in message
> news:yvUDd.6523$Vj3.1592@newssvr17.news.prodigy.co m...[color=green]
> > "berj" <berj@adelphia.net> wrote in message
> > news:F-udnT6v0otifkXcRVn-rg@adelphia.com...[color=darkred]
> > > Is it possible to access an Oracle sequence by using ODBC in MS[/color][/color][/color]
Access?[color=blue][color=green][color=darkred]
> > >
> > > I have been able to link to the Oracle tables, but need autonumbering[/color][/color]
> and[color=green]
> > I[color=darkred]
> > > am not able to change the column properties.
> > >
> > > Thanks![/color]
> >
> > I'm a bit confused by your question. I access many Oracle sequences[/color][/color]
from[color=blue][color=green]
> > Access using ADO. I don't understand what column properties you wish to
> > change. I can provide sample code, if that is of use to you.
> >
> >[/color]
>
>[/color] |