Gambas Documentation
Aperçu du Langage
À traduire
Code Snippets
Comment faire ...
Compilation et installation
Composants
gb
gb.args
gb.cairo
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.db
.Connection.Databases
.Connection.Tables
.Connection.Users
.Result.Fields
.SubCollection
.Table.Fields
.Table.Indexes
_Connection
Blob
Connection
Connections
Database
DatabaseUser
DB
Begin
Blob
Boolean
Charset
Close
Commit
Create
Current
Databases
Date
Debug
Delete
Edit
Error
Exec
Find
Float
Integer
Limit
Long
Open
Opened
Quote
Rollback
Serial
String
Subst
Tables
Users
Version
Field
Index
Result
ResultField
Table
gb.db.form
gb.dbus
gb.debug
gb.desktop
gb.desktop.gnome.keyring
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.mdi
gb.gmp
gb.gsl
gb.gtk
gb.gtk3
gb.gui
gb.image
gb.image.effect
gb.image.imlib
gb.image.io
gb.inotify
gb.libxml
gb.media
gb.mysql
gb.net
gb.net.curl
gb.net.smtp
gb.openal
gb.opengl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.option
gb.pcre
gb.pdf
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt5
gb.qt5.opengl
gb.report
gb.scanner
gb.sdl
gb.sdl.sound
gb.settings
gb.signal
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
Controls pictures
Derniers changements
Dépôt d'applications
Documentation de l'Environnement de développement
Documentation des développeurs
Documents
Indenter
Index de tous les Documents
Index du langage
Lexique
LISEZ-MOI
Manuel du wiki
Messages d'erreur
Tutoriels
Wiki License

DB.Edit (gb.db)

Static Function Edit ( Table As String [ , Request As String, Arguments As , ... ] ) As Result

Returns a read/write Result object used for editing records in the specified table.

  • Table is the table name.

  • Request is a SQL WHERE clause used for filtering the table (without the WHERE keyword).

  • Arguments are quoted as needed by the SQL syntax, and substituted inside the Request string

The last feature allows you to write requests that are independant of the underlying database type.

Once you have gotten the Result object, you can modify some of its fields. Then you can call the Result.Update method to send the changes to the database (i.e. omitting the corresponding UPDATE SQL statement).

Examples

DIM hResult AS Result
DIM sCriteria AS String
DIM iParemeter AS Integer

sCriteria = "id = &1"
iParameter = 1012

$hConn.Begin

' Same as "SELECT * FROM tblDEFAULT WHERE id = 1012"
hResult = $hConn.Edit("tblDEFAULT", sCriteria, iParameter)
' Set field value
hResult!Name = "Mr Smith"

' Update the value
hResult.Update
$hConn.Commit

See also