MS-SQL 2000, Access 2003, ADO 2.8
Please, consider the SQL string in the following code:
Dim r As ADODB.Recordset
Dim r2 As ADODB.Recordset
Set r = CurrentProject.Connection.Execute( _
"SET NOCOUNT ON " _
& "SELECT * FROM FFDBATransactions" _
& "; SET NOCOUNT ON " _
& "SELECT * FROM [4060148Transactions]")
Set r2 = r.NextRecordset
Debug.Print r.GetString(adClipString, 1, vbTab, vbNewLine)
Debug.Print r2.GetString(adClipString, 1, vbTab, vbNewLine)
Set r = Nothing
that is:
"SET NOCOUNT ON " _
& "SELECT * FROM FFDBATransactions" _
& "; SET NOCOUNT ON " _
& "SELECT * FROM [4060148Transactions]"
As I understand NOCOUNT, if we used this in a stored procedure the
first SET NOCOUNT ON would be valid for the whole stored procedure and
the second SET NOCOUNT ON would be redundant.
But what about using command text?
They are both useful?
Neither is useful?
The first is, but the second isn't?