-1

MySQL Does not UPDATE second column.

SQL = "UPDATE sampletable SET column1 = 'C1sample1'" & _
                ",column2 ='C2sample1'" & _
                "WHERE column2 = 'C2sample1'"
4
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by yorro
0

Are u developin a web app or a windows app ? which lang are u using for ur development? can u be a lil specific. Tx

0
Set column2 ='C2sample1'
WHERE column2 = 'C2sample1'"

If Column2 already equals C2Sample1, then your replacing the column value with the same exact value that your searching for.

0
SQL = "UPDATE sampletable 
                SET column1 = 'C1sample1',
                column2 ='NewValue' 
                WHERE column2 = 'OldValue'"
0
Set column2 ='C2sample1'
WHERE column2 = 'C2sample1'"

If Column2 already equals C2Sample1, then your replacing the column value with the same exact value that your searching for.

Thank you Tom, I noticed it now.

This is my actual code(bone structure)

Public Sub Update(ByVal Column1 As String, ByVal Column2 As String)
............
SQLString = "Set column2 ='" & Column2 &  "'
WHERE column2 = '" & Column2 &  "'"
............
............
End Sub
SQL = "UPDATE sampletable 
                SET column1 = 'C1sample1',
                column2 ='NewValue' 
                WHERE column2 = 'OldValue'"

Thank you adatapost for your reply, I clearly understand it now.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.