Click here to Skip to main content
15,915,829 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number [modified] Pin
_Erik_1-Mar-11 23:26
_Erik_1-Mar-11 23:26 
GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Memphis762-Mar-11 6:24
Memphis762-Mar-11 6:24 
GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Memphis762-Mar-11 14:02
Memphis762-Mar-11 14:02 
GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
_Erik_3-Mar-11 0:32
_Erik_3-Mar-11 0:32 
AnswerRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Luc Pattyn2-Mar-11 1:39
sitebuilderLuc Pattyn2-Mar-11 1:39 
GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Memphis762-Mar-11 6:25
Memphis762-Mar-11 6:25 
GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Luc Pattyn2-Mar-11 6:29
sitebuilderLuc Pattyn2-Mar-11 6:29 
AnswerRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Dave Kreskowiak2-Mar-11 9:28
mveDave Kreskowiak2-Mar-11 9:28 
Why are you renumbering the records in the table? With the information you have in the table, I see no need to reset the numbering. But, of course, this depends on what your'e doing with the data.


Memphis76 wrote:
I'm deleting all the records every time I run the SearchFolders() and the
auto-number kips incrementing otherwise)
I know this is done with the Do
Until i = 1 + (Last Folder Found)


For future reference... If your doing this in a single user system, this would be fine. If you attempt to do something like this in a multi-user system, this would fail miserably. Why?

In a multi-user system, you run into a concurrency issue. If two clients run the code that returns the previous ID number at the same time, or nearly the same time, they will both generate the same "next ID" number. Since neither client may have commited to writing their new record yet, even a third client (or more) can generate the same "next ID" number.

Autonumbering fields are best left up to the database. The database will make sure there is no concurrency issue by itself. You clients don't need to know the ID number immediately. All they would need to do is either create a new record in the table then retrieve the @@IDENTITY of the new record or call some database function to "checkout" a new ID. This all, of course, means that you don't care about the identity value or if there are holes in the numbering.

GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Memphis762-Mar-11 12:05
Memphis762-Mar-11 12:05 
QuestionBIFF7 Conversion Pin
Dominick Marciano1-Mar-11 10:13
professionalDominick Marciano1-Mar-11 10:13 
AnswerRe: BIFF7 Conversion Pin
Dave Kreskowiak1-Mar-11 15:11
mveDave Kreskowiak1-Mar-11 15:11 
GeneralRe: BIFF7 Conversion Pin
Thomas Krojer1-Mar-11 21:23
Thomas Krojer1-Mar-11 21:23 
QuestionIntercept e Send ALT+F1 Pin
starcomsis1-Mar-11 5:24
starcomsis1-Mar-11 5:24 
AnswerRe: Intercept e Send ALT+F1 Pin
Dave Kreskowiak1-Mar-11 8:58
mveDave Kreskowiak1-Mar-11 8:58 
GeneralRe: Intercept e Send ALT+F1 Pin
starcomsis1-Mar-11 9:20
starcomsis1-Mar-11 9:20 
GeneralRe: Intercept e Send ALT+F1 Pin
Dave Kreskowiak1-Mar-11 14:46
mveDave Kreskowiak1-Mar-11 14:46 
QuestionHow to set parallel port in VB programming? Pin
saathis1-Mar-11 4:22
saathis1-Mar-11 4:22 
AnswerRe: How to set parallel port in VB programming? Pin
DaveAuld1-Mar-11 4:57
professionalDaveAuld1-Mar-11 4:57 
AnswerRe: How to set parallel port in VB programming? Pin
Luc Pattyn1-Mar-11 6:10
sitebuilderLuc Pattyn1-Mar-11 6:10 
AnswerRe: How to set parallel port in VB programming? Pin
glennPattonWork32-Mar-11 21:55
professionalglennPattonWork32-Mar-11 21:55 
QuestionHow to save SQL Server 2008 Multiple Tables [modified] Pin
Paramu197328-Feb-11 3:09
Paramu197328-Feb-11 3:09 
AnswerRe: How to save SQL Server 2008 Multiple Tables Pin
DaveAuld28-Feb-11 4:07
professionalDaveAuld28-Feb-11 4:07 
GeneralRe: How to save SQL Server 2008 Multiple Tables Pin
Paramu197328-Feb-11 4:49
Paramu197328-Feb-11 4:49 
GeneralRe: How to save SQL Server 2008 Multiple Tables Pin
DaveAuld28-Feb-11 5:03
professionalDaveAuld28-Feb-11 5:03 
GeneralRe: How to save SQL Server 2008 Multiple Tables Pin
Paramu197328-Feb-11 7:22
Paramu197328-Feb-11 7:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.