Article ID: 195226
Article Last Modified on 1/23/2007
Private Sub Command1_Click()
Dim db As Database
Set db = DBEngine(0).OpenDatabase("", False, False, _
"ODBC;driver={SQL Server};server=xxx;uid=;pwd=;database=pubs")
db.Execute "Update authors set city = 'Paris' " _
& "where city = 'Oakland';", dbFailOnError
Debug.Print "To Paris:", db.RecordsAffected
db.Execute "Update authors set city = 'Oakland' " _
& "where city = 'Paris';"
Debug.Print "To Oakland:", db.RecordsAffected
db.Close
End Sub
NOTE: You must change the connect string in the OpenDatabase method to
point to a valid data source.
Microsoft DAO 3.5 Object Library
-or-
Microsoft DAO 3.51 Object Library
Additional query words: kbDSupport kbdse
Keywords: kbbug kbpending KB195226