Invalid SQL: INSERT INTO `swsessions` (`sessionid`, `ipaddress`, `lastactivity`, `useragent`, `isloggedin`, `sessiontype`, `typeid`, `dateline`, `status`) VALUES('40d0535c59ae4c0a1d9f22e3c6c7e68f', '54.81.157.56', '1503094819', 'CCBot/2.0 (http://commoncrawl.org/faq/)', '0', '40', '0', '1503094819', '0'); (The table 'swsessions' is full)
Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\support.inm.com\includes\functions.php:410) in C:\Inetpub\support.inm.com\includes\functions.php on line 1612
How to add, edit, delete and browse records in a simple V12 Database - Support Center
inm logo
Corporate Website | Contact | Store | Support | Login  
     


Knowledgebase
View categorized listing of all common frequently asked questions.
Downloads
View our categorized library of downloads for all necessary manuals, software, etc.
 Article Options
Support Center » Knowledgebase » INM V12 Database for Director » How to add, edit, delete and browse records in a simple V12 Database
Support Page Banner
 How to add, edit, delete and browse records in a simple V12 Database
Product:Platform:Area:Version:
INM V12 Database for DirectorWindows, MacintoshGeneral database and table useAll regular version

Summary

The reason why database's exist is essentially for the storage of information. It is thus primordial to understand how to add, edit and erase records. Once you have created your database, this technote will explain how it simple it really is to "work" with a V12 Database file.

Example

Adding Records to a Database

To add a new record to a V12 Database table, use mAddRecord. Calls to mAddRecord must be balanced by mUpdateRecord.

In the following example, a new record is created for the item "goggles" and its price is set to $158.99:

mAddRecord(gTable)
mSetField(gTable, "ItemName", "Goggles")
mSetField(gTable, "Price", 158.99)
mUpdateRecord(gTable)

If mUpdateRecord is not called, the record created with mAddRecord is not saved to the database. The only V12 Database method that can be called after mAddRecord and before mUpdateRecord are mSetField and mSetMedia, any other call will cancel the new record.

Editing a Record in a Database

Writing data is accomplished with mSetField. Prior to updating a field, you must set the current record, and your intentions must be indicated in V12 Database with mEditRecord. Once this is completed, V12 Database will update your database with mUpdateRecord.

Deleting a Record from a Database

Call mDeleteRecord to delete the current record or a table. The following line will delete the current record in the table "gTable".

mDeleteRecord(gTable)

After calling mDeleteRecord, the record which follows the record being deleted becomes the new current record. If no record follows the deleted record, the preceding record becomes the new current record. If no record precedes the deleted record, the selection is then empty and the current record is not defined.

Call mSelDelete to delete all the records of a selection at once.

mSelDelete(gTable)

After mSelDelete has been completed, the selection is empty and the current record is undefined.

Browsing records in a database

You can browse your selection with mGoNext, mGoPrevious, mGoFirst and mGoLast. You always have to specify the table you wish to browse in parenthesis.

mGoNext(gTable)
mGoFirst(gTable)

If you try to do mGoPrevious while on the first record or mGoNext while on the last record, the current record does not change and a warning is reported by INM V12 Database.

Note


For advanced information about adding, editing or browsing selections, please consult the V12 Database user manual. We also suggest that you download the following sample, which is a simple example that will easily show you how to deal with records in a V12 Database file.

Sample


This sample is supported on Director 6.5 and later. zip   sit



Article Details
Article ID: 104
Created On: 26 Sep 2006 02:24 PM

 This answer was helpful  This answer was not helpful

inm general footer
Services Xtras Go Products Support Gallery Store Download About Us Contact Newsroom