
Cannot make AddNew method work properly.
I'm using VB6 with SQL 6.5 . When I run the AddNew method the recordset
fields seem to update but not the recordcount or underlying database.
The code looks like this.
Dim FieldList(5)
Dim ValueList(5)
Set cnn1 = New ADODB.Connection
strCnn = "UserID=sa;Password=;DSN=SSITimeSheet;"
cnn1.Open strCnn
Set rs = New ADODB.Recordset
sSQL = "SELECT ManagementName FROM tblManagement"
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.Open sSQL, cnn1, , , adCmdText
FieldList(0) = "DeveloperID"
FieldList(1) = "ProjectID"
FieldList(2) = "TaskID"
FieldList(3) = "tsDate"
FieldList(4) = "tsTime"
FieldList(5) = "Notes"
'Set the field values
ValueList(0) = DeveloperID
ValueList(1) = ProjectID
ValueList(2) = TaskID
ValueList(3) = TaskDate
ValueList(4) = TaskTime
ValueList(5) = Note
rs.AddNew FieldList2, ValueList2
'Update the database
rs.Update
I have tried this and several other methods, non of which seem to work.
Your help will be greatly appreciated.
Lee Timms