Sun
ONE Active Server Pages Product Home Page Developer Site Version
 

ContentsPreviousNextIndex



ADO Field Object Value Property

Indicates the value assigned to a Field object.

Value Property Return Values (ADO Field Object)

Sets or returns a Variant value. Default value depends on the ADO Field Object Type Property.

Value Property Remarks (ADO Field Object)

Use the Value property to set or return data from Field objects. ADO allows setting and returning long binary data with the Value property.

Value Property Example (ADO Field Object)

This Visual Basic example demonstrates the Value property with Field and Property objects by displaying field and property values for the Employees table.

Public Sub ValueX() 
Dim rstEmployees As ADODB.Recordset 
Dim fldLoop As ADODB.Field 
Dim prpLoop As ADODB.Property 
Dim strCnn As String 
' Open recordset with data from Employee table. 
strCnn = "driver={SQL Server};server=srv;" & _ 
"uid=sa;pwd=;database=pubs" 
Set rstEmployees = New ADODB.Recordset 
rstEmployees.Open "employee", strCnn, , , adCmdTable
Debug.Print "Field values in rstEmployees" 
' Enumerate the Fields collection of the Employees 
' table. 
For Each fldLoop In rstEmployees.Fields 
` Because Value is the default property of a 
` Field object, the use of the actual keyword 
` here is optional. 
Debug.Print " " & fldLoop.Name & " = " & 
fldLoop.Value 
Next fldLoop
Debug.Print "Property values in rstEmployees" 
' Enumerate the Properties collection of the 
' Recordset object. 
For Each prpLoop In rstEmployees.Properties 
' Because Value is the default property of a 
' Property object, the use of the actual keyword 
' here is optional. 
Debug.Print " " & prpLoop.Name & " = " & 
prpLoop.Value 
Next prpLoop 
rstEmployees.Close 
End Sub


ContentsPreviousNextIndex