Is it necessary to close an Adodb.recordset object before setting it to nothing?

后端 未结 4 1615
猫巷女王i
猫巷女王i 2021-02-13 19:05
Dim rs as ADODB.Recordset
set rs = ReturnARecordset \'assume ReturnARecordset does just that...

\'do something with rs

rs.Close
set rs = Nothing

Is i

4条回答
  •  不要未来只要你来
    2021-02-13 19:59

    I needed to write many files. If I didn't close the connection after each file written then I got extraneous garbage at the end of subsequent files.

    fsT.Close
    

    followed by

    fsT.Open
    

    to "refresh" the output stream. So when I saved a new file, it was "clean".

提交回复
热议问题