vb.net - Error when inserting data into a MS Access table -
how can insert data ms access table? when try, getting error. code: if textbox1.text = nothing , textbox2.text = nothing msgbox("no username , password inserted") textbox1.focus() else if not con.state = connectionstate.open 'open connection if not yet open end if cmd.connection = con 'add data table cmd.commandtext = "insert logintable(username, password, typeofuser) values ('" & me.textbox1.text & "', '" & me.textbox2.text & "', '" & me.combobox1.text & "')" cmd.executenonquery() 'refresh data in list 'close connection con.close() end if first, don't open connection: con.open() next, password reserved word in ms access . need wrap password in square brackets: [password] you concatenating strings instead of using paramaters: cmd.parameters.add("@username", oledbtype.varchar...