database - VBA Excel 2003 disconnecting to DB object -
i have watched code execute. executes 'close' 'setting nothing'. returns the 'close' , throws error 91 "object variable block not set".
public sub closeitdown() ' clean , shut down cnxrptrs.close set cnxrptrs = nothing end sub
i have used code in many 'applications'. time using , start routine several times connecting , disconnecting db. clear temp tables , start different set of circumstance. around problem , want finish.
set cnxrptrs = new adodb.connection cnxrptrs.open strforcnx 'open connection. ...
the first time through there no problem on second time when problem happens.
if call close related object (conn, command, , rs objects set nothing). specific rules in help.
don't this
set cnxrptrs = nothing
and don't that
set cnxrptrs = new adodb.connection
what trying do, make boy of you, know it's at.
just close , (re) rs.open. command object check conn propery set.
Comments
Post a Comment