i have a database, i want to make it connected in vb..
tell me the coding for editing any record.

this following code for editing data. change as you needed.

' Edit Query
SQlQuery = "UPDATE Data " & _
           " SET Name ='" & Trim(txtName.Text) & "'," & _
           " Address ='" & Trim(txtAddress.Text) & "'," & _
           " TelpNo ='" & Trim(txtTlpNo.Text) & "'," & _
           " Email ='" & Trim(txtEmail.Text) & "'" & _
           " WHERE Id='" & Trim(txtId.Text) & "'"
            
' Execute Sql query
Con.Execute SQlQuery, , adCmdText
' Message if record already edited
MsgBox "Data Successfully Edited"

this following code for editing data. change as you needed.

' Edit Query
SQlQuery = "UPDATE Data " & _
           " SET Name ='" & Trim(txtName.Text) & "'," & _
           " Address ='" & Trim(txtAddress.Text) & "'," & _
           " TelpNo ='" & Trim(txtTlpNo.Text) & "'," & _
           " Email ='" & Trim(txtEmail.Text) & "'" & _
           " WHERE Id='" & Trim(txtId.Text) & "'"
            
' Execute Sql query
Con.Execute SQlQuery, , adCmdText
' Message if record already edited
MsgBox "Data Successfully Edited"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.