0
votes

Please help this would be my last problem in dealing with access database with vb.net if you could help me solve this. I'm trying to update ms access data using vb.net and here's my code:

updateuserclass.vb

Public Class UpdateUser

    Dim bankai As New Updater


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        bankai.unum = TextBox1.Text
        bankai.username = TextBox4.Text
        bankai.password = TextBox3.Text



        bankai.updates()
        MsgBox("Successfully updated!")
    End Sub

And here's the code in the form which tries to update the data:

Dim bankai As New Updater



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    bankai.unum = TextBox1.Text
    bankai.username = TextBox4.Text
    bankai.password = TextBox3.Text



    bankai.updates()
    MsgBox("Successfully updated!")



End Sub

What might be wrong in here?I set it all to string, is the primary key usernum not a string. What do I do, please help thanks.

2
I don't think the second piece of code is what you meant to paste. - mavnn

2 Answers

0
votes

What type is 'bankai.unum' ?

Maybe you have to convert it to an integer.

0
votes

If bankai.unum is an integer, you might need:

bankai.unum = CInt(TextBox1.Text)

but without the update code and the table schema it's a bit hard to tell.