Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I'm using Access db, and VB.NEt. My case is to generate 1000 student IDs, lets say from 1 to 1000. What is the best way to do that? and How?
Posted

Dear Robby

I think you are talking about Auto Number in Access. This is good but not enough. I'm trying to Insert 1000 id numbers at once. Currently, I'm thinking about making a loop with an insert statement. I will let you know what happens.

Posted

well ,

 

i dont know exactly why you need 1000 rows with the id fierlds

filled but data absent. i think you are using the id firled as a primary key or not the at least unique as there is no point having 2 students with the same id.

 

if you have problem tracking what is the id of the last inserted student than you can let access manage it by using autoincrement

as robby pointed out.

 

Else you can have another table in the same database that has one row only and it stores the last inserted number. Every time you insert a record you incrementy this number before the actual insertion.

 

in this way even if the number is updated but entry fails then too you will have unique ids.

although there is a chance that u may some nos in between

Posted

This is what happened. I was able to insert 1000 id by using a loop. But I'm considering what Robby and hemenkap seriously. So, I'm no gonna use this loop.

Thank you all.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...