How to retrieve data from database using scripts
We
can use ADODB.Recordset to get the
recordset object.
Set MyRecordSet=CreateObject(“ADODB.Recordset”)
Properties and Methods of Recordset
object:
The
properties and methods of Recordset object are veryuseful in getting the
database records.
Recordset Properties:
RecordSet Properties
|
Description
|
AbsolutePage
|
Page of current position
|
AbsolutePosition
|
Current position
|
ActiveConnection
|
Active Connection Object
|
BOF
|
Beginning of File
|
Bookmark
|
Bookmark of current position
|
CacheSize
|
Number of records cached
|
CursorLocation
|
Server or Client
|
CursorType
|
Forward, Static, Dynamic, Keyset
|
EOF
|
End of File
|
EditMode
|
Whether or not an edit is in progress
|
Filter
|
What kind of records to hide
|
LockType
|
Record lock type for edits or updates
|
MaxRecords
|
Maximum number of records to retrieve
|
PageCount
|
Total number of pages
|
PageSize
|
Number of records per page
|
RecordCount
|
Total number of records
|
Source
|
Source Command Object
|
Status
|
Status of last action
|
Recordset Methods:
Recordset Methods
|
Description
|
AddNew
|
Add a new record to the
RecordSet
|
CancelBatch
|
Cancel pending batch
updates
|
CancelUpdate
|
Cancel pending update
|
Clone
|
Copy the RecordSet
|
Close
|
Close the RecordSet
|
Delete
|
Delete current record
|
GetRows
|
Retrieve multiple records
|
Move
|
Move the record pointer to a
specific record
|
MoveNext
|
Move the record pointer to
the next record
|
MovePrevious
|
Move the record pointer to
the previous record
|
MoveFirst
|
Move the record pointer to
the first record
|
MoveLast
|
move the record pointer to
the last record
|
NextRecordSet
|
Load the next RecordSet in
a multi-set query
|
Open
|
Open the RecordSet (execute
the query)
|
Requery
|
Re-execute the last query
executed
|
Resync
|
Synchronize the data with
the server
|
Supports
|
Determine if a feature is supported
by provider
|
Update
|
Update the current record
|
UpdateBatch
|
Update pending batched
record updates
|