| | |
access UPDATE problems
Please support our MS Access and FileMaker Pro advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2004
Posts: 13
Reputation:
Solved Threads: 0
i have a very simple access DB and im tryin to update the records but the update never works. im using asp.net/vb.net and i've include the execute in a try/catch block and it always prints the sql string (the catch). here is my code, perhaps i have an error that ive missed:
im also adding a user ID soon and will be changing the where to check for the unique ID.
SQL = "UPDATE members " & _
"SET username = '" & txtUsername.Text.Trim() & "', " & _
"password = '" & txtPassword1.Text.Trim() & "', " & _
"first_name = '" & txtFirstName.Text.Trim() & "', " & _
"last_name = '" & txtLastName.Text.Trim() & "', " & _
"email = '" & txtEmail.Text.Trim() & "'" & _
"WHERE first_name = " & Session("first_name") & _
"AND last_name = " & Session("last_name") & ""
' Check if connection to DB is already open
If MyConn.State = ConnectionState.Closed Then
MyConn.Open()
End If
Dim MyCmd As New OleDbCommand(SQL, MyConn)
' Try/Catch...in case DB error
Try
MyCmd.ExecuteNonQuery()
MyConn.Close()
MyConn.Equals("")
Response.Redirect("default.aspx")
Catch ex As Exception
profile_error.Text = SQL
profile_error.Style("Color") = "red"
End Tryim also adding a user ID soon and will be changing the where to check for the unique ID.
![]() |
Similar Threads
- Boot Problems after bios update (Troubleshooting Dead Machines)
- Hard Drive Access Problems! (Windows NT / 2000 / XP)
- Second p.c cannot access the internet over the network. (Networking Hardware Configuration)
- Windows Update Problems (Viruses, Spyware and other Nasties)
- Hijack This Log - Internet Explorer - Problems accessing websites (Viruses, Spyware and other Nasties)
- Hijack This Log - IE problems accessing websites (Viruses, Spyware and other Nasties)
- Errors in My XP Error Log. (Windows NT / 2000 / XP)
Other Threads in the MS Access and FileMaker Pro Forum
- Previous Thread: Access INSERT problem
- Next Thread: Access App. for WM 2003
| Thread Tools | Search this Thread |





