Problem with OleDBCommand Update

M

Mark Sandfox

The following code does nothing (not even give an error). The record
remains the same.

Sub Save_The_Buzz(Sender as Object, E as EventArgs)
Dim cnTheBuzz as OleDbConnection
Dim strUpdate as string
Dim cmdUpdate as OleDbCommand

cnTheBuzz = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\Inetpub\wwwroot\SAB\sdb\TheBuzz.mdb")
strUpdate = "Update TheBuzz Set TheBuzz=@TheBuzz Where ID = 1"

cmdUpdate = New OleDbCommand(strUpdate, cnTheBuzz)
cmdUpdate.Parameters.Add("@TheBuzz",tbTheBuzz.Text)

'place try-catch routine here
cnTheBuzz.Open()
cmdUpdate.ExecuteNonQuery()
cnTheBuzz.Close()

Response.Redirect( "DE_the_buzz_update_confirm.aspx" )
End Sub


Scratching my head because this code has been reused a hundred times in the
past.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top