Re: ? - Get MSAccess to make Prim. Key AutoNumber (connected to Oracle)

From: LMLinson <lmlinson_at_aol.com>
Date: 1998/09/01
Message-ID: <1998090104352100.AAA07606_at_ladder01.news.aol.com>#1/1


In article <01bdd51d$73ee3200$6b369e84_at_SC007541.mis.semi.harris.com>, "RG" <Z.Grow_at_mci2000.com> writes:

>I have an Access database which, using ODBC/SQLNet, is connected to an
>Oracle database. I want Access to interpret the primary key field of the
>Oracle table as an "AutoNumer" type. Any ideas on how to do this?

If you are trying to avoid the problem of having all your controls change to "#Deleted" when you actually save the record from data entry mode by having _Access_ do the AutoNumbering instead of Oracle, you can't do it that way. The AutoNumber or "Serial Field" or whatever Oracle calls it is done by the database engine, in your case, Oracle.

What you can do, as we did with an Access client to Informix, is to have a table in Oracle with the names of your tables and the highest key used, create a stored procedure in Oracle to increment and return the key number for the table whose name you provide. Then you will be setting the key rather than using Oracle's AutoNumber, Access and the Jet engine won't lose track of it, and you won't see all those "#Deleted"s in your controls.

If that's not what you are trying to accomplish, perhaps you could clarify... it's always best to state what the problem is rather than ask how to implement a particular solution, which may not work. Chances are _someone_ in this convival gathering may have solved a similar problem -- but not necessarily the way you had in mind to solve it.  

>Please email me at rgrow_at_harris.com

I certainly hope this was of sufficient importance for you to read the newsgroup to get your answer. After all, you thought it was important enough for me to read the newsgroup to get your question.   Received on Tue Sep 01 1998 - 00:00:00 CEST

Original text of this message