Page loading

  
    
     
trans

 

CPDB.Net

 

[fr]
trans
[en]

 

Welcome
Welcome

 

News
News

 

Downloads
Downloads

 

Forum
Forum

 

Stats
Stats

 

 

Admin
Admin

trans

Return to :

PPCompiler

trans

Index

CPDB library
1- Add CPDB support to your application
2- Open and close databases
3- Browse operations
4- Fields operations
5- Functions of modification of a database
6- Sort and search operations
7- Index of functions
8- Error codes
Documentation
CPDB Conduit
CPDB Features

trans

Webmaster

Webmaster : Palmipod

E-mail : phc­@­palmipod­.­com

This site requires web browsers to be at least version 4.

trans

Visits (since August 2006)

  visitors

  visitor online

trans

trans

5- Functions of modification of a database




Introduction

With CPDB, you can dynamically create a structured database and add, modify or remove the records which it contains. Usually, these treatments requires tens of lines of code.



To create a CPDB database


Here an example which shows with which facility you can create a CPDB database:





// Create user base
Err errNo;
if (!CPDB_DatabaseExist("USERS"))
{
errNo = CPDB_CreateDatabase(0, "USERS", 'CPDB',
"NUM=INT;NAME=STRING[20];SURNAME=STRING[20];GROUP=SHORTINT");
}

The data base is thus created in only one line of code.


The mask of description is described in detail in the documentation of CPDB_CreateDatabase.


Add a record

The addition of a record is carried out in only one line of code :





// Create a new record
Err errNo;
errNo = CPDB_AddRecord(handle);

The variable "handle" corresponds to the handle of a beforehand open database.


If no record had been read previously, then a blank recording is created, if not, the new record is a copy of the currently record readed (or modified).


To be sure to create a blank record use function CPDB_Clear.


To delete a record, use the fonction CPDB_DeleteRecord.



Modification of a record


The fields of a record can by the use of the functions CPDB_WriteShortInt, CPDB_WriteInt, CPDB_WriteLongInt et CPDB_WriteString.


Once the modified fields, the record should either be updated by CPDB_updateRecord, or to create a new record by CPDB_AddRecord.





Err errNo;


// Update the fields of a record
CPDB_Clear(handle);
errNo = CPDB_WriteInt(handle, "NUM", iNum);
errNo = CPDB_WriteString(handle, "NAME", sName);
errNo = CPDB_WriteShortInt(handle, "GROUP", iGroup);

if ( bAddMode )
{
// Create a new record
errNo = CPDB_AddRecord(handle);
}
else
{
// Modification of the current record
errNo = CPDB_UpdateRecord(handle);
}


More informations


CPDB_AddRecord


CPDB_CreateDatabase


CPDB_WriteShortInt


CPDB_WriteInt


CPDB_WriteLongInt


CPDB_WriteString


CPDB_UpdateRecord


CPDB_Clear


CPDB_DeleteRecord


Creation date : 01/10/2003 @ 06:41
Last update : 01/10/2003 @ 07:31
Category : CPDB library
Page read 9130 times

Print previewPrint preview

  

Print the pagePrint the page

Mobile

Mobile version of CPDB.net

trans

Library

CPDB.net Library

This PalmOS library is compiled in C. It is provided with its .h file and documentation.


The library can be used by all applications developed with CodeWarrior, Falch.net or PRC-Tools.


Included :
Generic conduit for CPDB.net and CPDBWizard


The generic conduit CPDBConduit allows to convert a PC database in a CSV-like format into a Palm database (CPDB format).


CPDBWizard enables you to describe your data bases and generates for you the source code necessary to their exploitation.

trans

Search

trans

trans

trans

Top

trans

GuppY - http://www.freeguppy.org/
Site running with GuppY v3.1 - GNU Public License - © 2002-2024

trans

Page loaded in 0.04 second