SQL Server Performance

Updating Recordset

Discussion in 'SQL Server DTS-Related Questions' started by deepak_khattar, Feb 24, 2004.

  1. deepak_khattar New Member

    Following is my code to update a RecordSet, but it gives error that updating of recordset is not supported....
    Any insight into this....

    Function Main()
    dim countr
    dim RS
    set RS = CreateObject("ADODB.Recordset")
    set RS = DTSGlobalVariables("TableNames").value

    for countr = 1 to RS.RecordCount
    msgbox RS.Fields("name").value
    RS("CompanionRecCount") = 0
    RS("CentralRecCount")= 0

    Main = DTSTaskExecResult_Success
    End Function

    Deepak Khattar
    World Health Organisation
    Geneva, Switzerland
  2. satya Moderator

    What is the exact error while executing the script?
    Ensure necessary privileges are assigned to the login that executes the DTS package.

    Satya SKJ
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  3. cnu77 New Member

    Prob this error might have happn'd due to the RS.Movefirst line. This is bcos, the RS is Forward Only and Read-Only in VBScript...
    To overcome this u can try issuing "UPDATE" Query.
    Check it...


Share This Page