Connecting Tech Pros Worldwide Forums | Help | Site Map

Accessing Oracle Sequences via ODBC

berj
Guest
 
Posts: n/a
#1: Nov 13 '05
Is it possible to access an Oracle sequence by using ODBC in MS Access?

I have been able to link to the Oracle tables, but need autonumbering and I
am not able to change the column properties.

Thanks!



Chuck Insight
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Accessing Oracle Sequences via ODBC


No similar strructure exists in Access.

"berj" <berj@adelphia.net> wrote in message
news:F-udnT6v0otifkXcRVn-rg@adelphia.com...[color=blue]
> Is it possible to access an Oracle sequence by using ODBC in MS Access?
>
> I have been able to link to the Oracle tables, but need autonumbering and[/color]
I[color=blue]
> am not able to change the column properties.
>
> Thanks!
>
>[/color]


Randy Harris
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Accessing Oracle Sequences via ODBC


"berj" <berj@adelphia.net> wrote in message
news:F-udnT6v0otifkXcRVn-rg@adelphia.com...[color=blue]
> Is it possible to access an Oracle sequence by using ODBC in MS Access?
>
> I have been able to link to the Oracle tables, but need autonumbering and[/color]
I[color=blue]
> am not able to change the column properties.
>
> Thanks![/color]

I'm a bit confused by your question. I access many Oracle sequences from
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.


berj
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Accessing Oracle Sequences via ODBC


It would be of great help if you could provide the sample code.

Thanks!


"Randy Harris" <randy@SpamFree.com> wrote in message
news:yvUDd.6523$Vj3.1592@newssvr17.news.prodigy.co m...[color=blue]
> "berj" <berj@adelphia.net> wrote in message
> news:F-udnT6v0otifkXcRVn-rg@adelphia.com...[color=green]
> > Is it possible to access an Oracle sequence by using ODBC in MS Access?
> >
> > I have been able to link to the Oracle tables, but need autonumbering[/color][/color]
and[color=blue]
> I[color=green]
> > am not able to change the column properties.
> >
> > Thanks![/color]
>
> I'm a bit confused by your question. I access many Oracle sequences from
> 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]


Randy Harris
Guest
 
Posts: n/a
#5: Nov 13 '05

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]


berj
Guest
 
Posts: n/a
#6: Nov 13 '05

re: Accessing Oracle Sequences via ODBC


Thanks for the code.

"Randy Harris" <randy@SpamFree.com> wrote in message
news:J3bEd.7293$Vj3.3755@newssvr17.news.prodigy.co m...[color=blue]
>
> "berj" <berj@adelphia.net> wrote in message
> news:jPCdnf1TnrowcX3cRVn-qA@adelphia.com...[color=green]
> > 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),[/color]
re-establish[color=blue]
> 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=green]
> > "Randy Harris" <randy@SpamFree.com> wrote in message
> > news:yvUDd.6523$Vj3.1592@newssvr17.news.prodigy.co m...[color=darkred]
> > > "berj" <berj@adelphia.net> wrote in message
> > > news:F-udnT6v0otifkXcRVn-rg@adelphia.com...
> > > > Is it possible to access an Oracle sequence by using ODBC in MS[/color][/color]
> Access?[color=green][color=darkred]
> > > >
> > > > I have been able to link to the Oracle tables, but need[/color][/color][/color]
autonumbering[color=blue][color=green]
> > and[color=darkred]
> > > I
> > > > am not able to change the column properties.
> > > >
> > > > Thanks!
> > >
> > > I'm a bit confused by your question. I access many Oracle sequences[/color][/color]
> from[color=green][color=darkred]
> > > Access using ADO. I don't understand what column properties you wish[/color][/color][/color]
to[color=blue][color=green][color=darkred]
> > > change. I can provide sample code, if that is of use to you.
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Closed Thread