Article ID: 195491
Article Last Modified on 3/2/2005
sp_configure "user options", 512
Turns off the message returned at the end of each statement that states how many rows were affected by the statement.The following statement is from the Transact SQL Help regarding @@ROWCOUNT:
Any Transact-SQL statement that does not return rows (such as an IF statement) sets @@ROWCOUNT to 0.SET NOCOUNT ON suppresses DONE_IN_PROC messages. The result is an error message generated by the provider that depends on the @@ROWCOUNT value for rows affected.
Dim ADOCn As ADODB.Connection
Dim ADORs As ADODB.Recordset
Dim strConnect As String
strConnect = "Provider=MSDASQL;Driver={SQL
Server};Server=(local);Database=Pubs;Uid=<user name>;Pwd=<strong password>"
Set ADOCn = New ADODB.Connection
With ADOCn
.ConnectionString = strConnect
.CursorLocation = adUseServer
.Open
End With
Set ADORs = New ADODB.Recordset
With ADORs
.ActiveConnection = ADOCn
.CursorLocation = adUseServer 'adUseClient
.CursorType = adOpenKeyset 'adOpenStatic
.LockType = adLockOptimistic
.Open "SELECT * FROM Authors"
End With
ADORs.Fields("au_lname").Value = ADORs.Fields("au_lname").Value
ADORs.Fields("au_fname").Value = ADORs.Fields("au_fname").Value
ADORs.Update
sp_configure 'user options',0
GO
RECONFIGURE
GO
195225 PRB: DAO Run-Time Error 3146 When Modifying SQLServer Data
Keywords: kbdatabase kbprb KB195491