Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AutoInc value and CA
Message
From
02/02/2007 09:34:19
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01191628
Message ID:
01191764
Views:
29
This message has been marked as the solution to the initial question of the thread.
Naomi, this works perfect in VFP9:
CREATE DATABASE DATA1
OPEN DATABASE DATA1
CREATE TABLE Table1 (Id Int AUTOINC NEXTVALUE 1, Name C(50))
CLOSE DATABASES ALL

oCa = NEWOBJECT([oCa])
oCA.CursorFill()
CURSORSETPROP("Buffering",5,oCA.Alias)
FOR asd = 1 TO 50
    INSERT INTO (oCA.Alias) (Name) VALUES ([77777])
NEXT
IF NOT TABLEUPDATE(1, .t., oCA.Alias)
   AERROR(aaa)
   Messagebox(aaa[1,2])
ENDIF
BROWSE 
FOR asd = 1 TO 50
    INSERT INTO (oCA.Alias) (Name) VALUES ([77777])
NEXT
BROWSE 
TABLEREVERT(.t.,oCa.Alias)
BROWSE 
SELECT Table1
BROWSE 




**************************************************
*-- Class:        oca (d:\catest\testme.vcx)
*-- ParentClass:  cursoradapter
*-- BaseClass:    cursoradapter
*-- Time Stamp:   02/02/07 03:40:10 PM
*
#INCLUDE "d:\all_zapl\include\aladin.h"
*
DEFINE CLASS oca AS cursoradapter


    Height = 22
    Width = 23
    SelectCmd = "select ID, NAME from TABLE1"
    CursorSchema = "ID I, NAME C(50)"
    Alias = "cursor1"
    DataSourceType = "Native"
    Flags = 0
    FetchSize = -1
    WhereType = 1
    KeyFieldList = "ID"
    Tables = "TABLE1"
    UpdatableFieldList = "NAME"
    UpdateNameList = "ID TABLE1.ID, NAME TABLE1.NAME"
    InsertCmdRefreshFieldList = "ID"
    InsertCmdRefreshKeyFieldList = ""
    InsertCmdRefreshCmd = "SELECT Id FROM Table1 WHERE Id = GETAUTOINCVALUE(0)"
    RefreshIgnoreFieldList = ""
    Name = "oca"


    PROCEDURE Init
        *** Setup code: DO NOT REMOVE
        set multilocks on
        llReturn = dodefault()
        *** End of Setup code: DO NOT REMOVE
        *** Select connection code: DO NOT REMOVE

        local lcDBC
        lcDBC = 'DATA1.DBC'
        if dbused(lcDBC)
            set database to (lcDBC)
        else
            open database (lcDBC)
        endif
        *** End of Select connection code: DO NOT REMOVE

        *** Setup code: DO NOT REMOVE
        return llReturn
        *** End of Setup code: DO NOT REMOVE
    ENDPROC

ENDDEFINE
*
*-- EndDefine: oca
**************************************************
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform