Update statement


"UPDATE [Student] SET [StudentStatus] = 'Old'
  WHERE (([StudentStatus] = 'New')
  AND (RegDate = 2001/02/02')
  AND (StudNo = 200144176))"

Option Explicit
 
Dim conn as ADODB.Connection
Dim rs AS ADODB.Recordset
 
Private sub Form_load()
Set conn = new ADODB.Connection
Set rs = New ADODB.Recordset
 
conn.open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog= TEST ;Data Source=NOCOMP" 
 
 
Private Sub cmdUpdate _Click)
Dim stSQL As String
 
stSQL = "UPDATE [Student] SET [StudentStatus] = 'Old' WHERE " _
& "(([StudentStatus] = 'New') AND (RegDate = '" & putdatehere & "') " _
& "AND (StudNo = " & putstudentnohere & "))"
 
conn.Execute stSQL
end sub