Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
3_autoincrement_autoincerror.prg
Package: AutoIncrement.rar [view]
Upload User: szlqfpcb
Upload Date: 2020-05-18
Package Size: 5k
Code Size: 2k
Category:
Database system
Development Platform:
VFP
- ********************************************************************************
- * 3_AutoIncrement_AutoIncError.prg
- * Description: This program will show how to use Scatter / Gather with auto
- * increment fields by setting the AutoIncError to 'OFF' in order
- * to suppress a Read-only error from being thrown.
- * Tip: The AutoIncError setting can be set globally by using SET AUTOINCERROR.
- ********************************************************************************
- #DEFINE CRLF CHR(13)+CHR(10)
- LOCAL lcStr as String
- LOCAL lnSelect as Integer
- * Save environment and erase auto increment table.
- lnSelect = SELECT()
- SELECT 0
- ERASE _AI_Table.dbf
- * Create Auto Increment table setting the 'iID' column as an auto increment field
- * with the starting value set to 1 and the increment value set to 1.
- CREATE TABLE AI_Table FREE ;
- ( iID i AUTOINC NEXTVALUE 1 STEP 1, ;
- CustName c(30))
- * Insert three records into the table. You do not assign any values to the auto
- * increment field.
- INSERT INTO AI_Table (CustName) VALUES ("Jane Smith")
- INSERT INTO AI_Table (CustName) VALUES ("John Doe")
- INSERT INTO AI_Table (CustName) VALUES ("Greg Jones")
- GO TOP
- * Browse the table.
- BROWSE NOWAIT
- lcStr = "Auto Increment Table created with the starting value set to 1 and" + ;
- " the increment set to 1"
- MESSAGEBOX(lcStr)
- * Scatter the current record
- SCATTER MEMVAR
- * Set the AutoIncError setting for the cursor to OFF to suppress the error and
- * ignore the replacement value when a value is copied into the auto increment
- * field.
- CURSORSETPROP("AutoIncError","OFF")
- * Append a new record and replace the fields with the values from the Scatter.
- APPEND BLANK
- GATHER MEMVAR
- * Browse the table.
- BROWSE NOWAIT
- lcStr = "Auto Increment Table was altered to set the next auto increment value" + ;
- " to 100 and the increment step to 10"
- MESSAGEBOX(lcStr)
- * Restore environment.
- USE
- SELECT (lnSelect)
- RETURN