08-02-2010 10:08 PM
HI here is my question
I have a VI of a Log-in , and I want to put
an option where you can add a new user, but a don't know how
to save the new user and password on a table that a made on access
can someone help me?
08-02-2010 10:58 PM
well you can use Activex or if you have the database connectivity toolkit you can use it to connect to Access and save your data
08-03-2010 03:50 AM
Hi,
Ya thats true you have to make creat table in data base or exel.
Let me alobarate in brief. There are lot many other ways but simple one is
Creat new vi say name it add user.vi
You creat a table say User details. on Front panel.
Column name Username , User level ( If you have) , Password.
This table you can save into the database as well as into the binary file So that others cant view.
Creat a string control User name and two string control for password repeatablity check. and userlevel if you want (admin, sup, operator)
Creat two button name Add user and Cancle ( Or close window you can use).
On add User Event "check both password are same" and "user already there", Then you can add user name, User level , password into the table.
Thats it.
This table you can use in Login.vi
Read this table for login vi.
Thanks
08-03-2010 06:48 PM
I didnt understand exactly what you say, but i made it using sql code to write user and password to the access table 🙂
On add User Event "check both password are same" and "user already there", Then you can add user name, User level , password into the table.
Thats it.
How can I check if the user is already there?.
Thanks
08-03-2010 06:57 PM - edited 08-03-2010 06:59 PM
Select <username> from <namecolumn>
If you get a value back, it's there.
There may be a better way, I haven't used DB queries too much.
If you want to add it if it doesn't exist already, have a look at this article
http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
08-03-2010 07:09 PM - edited 08-03-2010 07:12 PM
sorry, posted wrong link above ^^^. Here are a couple links you may find useful
http://stackoverflow.com/questions/61033/how-to-check-if-a-value-exists-in-sql-table
http://www.xaprb.com/blog/2005/09/25/insert-if-not-exists-queries-in-mysql/
08-03-2010 07:52 PM
Hey thanks, I try some examples but didnt function, but thanks anyway. 😄
08-03-2010 09:45 PM
At this point you should really post your code and your access database for people to help you figure out what's going on.
08-03-2010 11:47 PM
Well here's the block diagram, someone gave me a code on SQL
but I don't know were to put it, he said that on ADO
But don't know what ADO, and how to use it
*****************code **********************
"select * from login where usuario='" & txtusuario & "' and contrasena='"
& txtcontrasena & "'"
if adodc1.recordcount>0 then
msgbox "User and password repeated"
else
'add values
end if
08-04-2010 09:38 AM
You have not posted your code. You posted an image which cannot be debugged. You would also need to post those SQL functions. Those are not from the NI toolkit or the commonly used LabSQL toolkit.