VB中recordset对象常用方法有哪些

在VB中,常用的recordset对象方法有:

Open:打开一个数据库连接,并指定要访问的表或查询的名称。

recordset.Open "SELECT * FROM table_name", connection

Close:关闭一个打开的recordset对象。

recordset.Close

MoveFirst:将记录指针移动到记录集的第一个记录。

recordset.MoveFirst

MoveLast:将记录指针移动到记录集的最后一个记录。

recordset.MoveLast

MoveNext:将记录指针向后移动到记录集中的下一条记录。

recordset.MoveNext

MovePrevious:将记录指针向前移动到记录集中的上一条记录。

recordset.MovePrevious

Find:根据指定的条件在记录集中查找符合条件的记录。

recordset.Find "field_name = 'value'"

AddNew:在记录集中添加一条新记录。

recordset.AddNew

Update:更新当前记录集中的记录。

recordset.Update

Delete:删除当前记录集中的记录。

recordset.Delete

GetString:返回记录集中的数据作为字符串。

strData = recordset.GetString

GetRows:返回记录集中的数据作为数组。

arrData = recordset.GetRows
阅读剩余
THE END