
652 Chapter 14 • Upgrading Visual Basic Applications to .NET
objCn.ConnectionString = strSQLConn
objCn.Open()
objRs.Open("Select au_lname from authors", objCn,
ADODB.CursorTypeEnum.adOpenForwardOnly,
ADODB.LockTypeEnum.adLockReadOnly)
While Not objRs.EOF
Debug.WriteLine(objRs(0).Value)
objRs.MoveNext()
End While
objRs.Close()
objCn.Close()
Using Date Data Type
In Visual Basic 6.0, you could use the Double data type to store and manipulate
dates.This is not supported in Visual Basic .NET, however, because dates are not
stored as doubles.Therefore, the following code is invalid in Visual Basic .NET:
Dim dblVal as Double
Dim dtVal as Date
dtVal = now
dblVal = dtVal ...