In my Access database project, SQL server as backend, there're several functions have this repeated piece of code. I wonder if it's OK to declare the two variables (one for ADODB command, another is for RecordSet) as global? will that cause any potential problems? Thanks very much.
Dim cmd As ADODB.Command, rst As ADODB.Recordset
Set cmd = New ADODB.Command
cmd.ActiveConne ction = CurrentProject. Connection
Dim cmd As ADODB.Command, rst As ADODB.Recordset
Set cmd = New ADODB.Command
cmd.ActiveConne ction = CurrentProject. Connection
Comment