K
Kevin R
This week I've begun to learn vb.net by re-writing an existing VB app. I'm
having a difficult time figuring how to add new records to an ADODB
recordset. How would I re-write the '.AddNew' statement in vb.net?
Thanks in advance!
Kevin
================
-----vb6
' Populate the local table
While Not rs.EOF
With rsLocal
.AddNew
!User_Login = rsSQL("User_Login")
!Current_Status = rsSQL("Current_Status")
.Update
End With
rs.MoveNext
Wend
================
-----vb.net
I get the build error in vb.net "Property 'Fields' is 'ReadOnly'. What is
the proper syntax to this: rsLocal!User_Login = rsSQL("User_Login")
' Reopen local table
sSQL = "Select * from tblStudentAdmissionsData"
rsLocal.Open(sSQL, cnLocalConnection, ADODB.CursorTypeEnum.adOpenDynamic,
ADODB.LockTypeEnum.adLockOptimistic)
With rsLocal
rsLocal.AddNew()
rsLocal!User_Login = rsSQL("User_Login")
having a difficult time figuring how to add new records to an ADODB
recordset. How would I re-write the '.AddNew' statement in vb.net?
Thanks in advance!
Kevin
================
-----vb6
' Populate the local table
While Not rs.EOF
With rsLocal
.AddNew
!User_Login = rsSQL("User_Login")
!Current_Status = rsSQL("Current_Status")
.Update
End With
rs.MoveNext
Wend
================
-----vb.net
I get the build error in vb.net "Property 'Fields' is 'ReadOnly'. What is
the proper syntax to this: rsLocal!User_Login = rsSQL("User_Login")
' Reopen local table
sSQL = "Select * from tblStudentAdmissionsData"
rsLocal.Open(sSQL, cnLocalConnection, ADODB.CursorTypeEnum.adOpenDynamic,
ADODB.LockTypeEnum.adLockOptimistic)
With rsLocal
rsLocal.AddNew()
rsLocal!User_Login = rsSQL("User_Login")