Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoIncrement in view table

Status
Not open for further replies.

ameedoo3000

IS-IT--Management
Sep 20, 2016
233
EG
hi all
is there any way to set AutoIncrement field in the view table in VFP 9.0 ?
 
can't find any solution; however your autoInc would conflict with the base table's
 
A view is simply a way of looking at a physical table. It's the physical table that has the Autoinc field. If you want the records in a view to be sequentially numbered independently of the underlying table, you would have to make the view updatable, and then run some code to update an integer field with the required values. But I can't think of any reason why you would want to do that.

Perhaps you could tell us what your overall aim is?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
hi M.Mike
1_r2lo0m.png

2_wnrawd.png

my goal is fill the ID field (id_a)Automatically when i fill name field and the (id_b) value = (id_a) value

Greetings
Ahmed
 
Sorry, but I'm confused. You say you want to fill in ID_A automatically when ID_A = ID_B. But in that case, how can you fill in ID_A? By definition it already has a value: the same value as ID_B.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Autoinc fields are readonly, they are set by the database table only. So to get a new record in the view, it has to be created in table1,table2 and then queried.

Bye, Olaf.

 
Hi ameedoo,

There seems to be a slight misunderstanding what views are, how you handle them and what they are able to do.
Please have a look at the following article

Link

There are books about VFP views, but this article might give you first insights

hth

MK
 
I apologize to everyone Mike,Olaf and Mjcmkrsr
I did not properly describe my goals
My Goal is :
1- fill in (ID_A,ID_B) automatically
2- show the numbers in ID_A and ID_B in this view
I found the solution through your feedback and through the example provided by Mjcmkrsr
he problem was to update the view to show automatic numbers [ Through the code "Requery()"]

Thank you very much
Greetings
Ahmed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top