Click here to Skip to main content
15,921,643 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want create office application in visual basic 2010 with password and email id and contact mobile no , but it's split a err that " err in insert into " statement .
please help me to solves this.i was already write a dbcontrol.class code to connect access detabase and it run a perfectly.

yogesh vaidya

What I have tried:

Private Sub saveuserdata()
       access.execquery("select * from userdata ORDER BY username ASC")
       If NOTEMPTY(access.exception) Then MsgBox(access.exception) : Exit Sub
       'Add parameter
       'Add parameter
       access.addparam("@usernm", Textusername.Text)
       access.addparam("@pass", txtpassword.Text)
       access.addparam("@fnm", txtfirstname.Text)
       access.addparam("@lnm", txtlastname.Text)
       access.addparam("@email", txtemail.Text)
       access.addparam("@cont", txtcontact.Text)
       access.execquery("insert into a_sbupdate (username,[password],firstname,lastname,e-mail,mobaile_no) " & _
                       "values(@usernm,@pass,@fnm,@lnm,@email,@cont); ")

       If Not String.IsNullOrEmpty(access.exception) Then MsgBox(access.exception) : Exit Sub
       MsgBox("USER ADDED SUCCESSFULY !!! ,LOGIN TO PROSIDE MORE... ")
       Me.Close()
       Form1.Show()
Posted
Updated 30-May-17 22:36pm

Do not store passwords in clear text; please read Secure Password Authentication Explained Simply[^].
 
Share this answer
 
Column name: "e-mail" is not valid as hyphen is an operator.
I'd change it to "Email", but you could just bracket it: "[e-mail]"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900