On Aug 07, 2006, at 12:07 PM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote:

Thanks alot for the help.

However, as I try to learn... and I've been reading everything I can find on sql... am I assuming that in
the line

sql = "insert into users (username, password, securitygrp) VALUES
( '" + edituser.text + "', '" + editpassword.text + "', '" +
popupsecuritygrp.text + "')"

the "," is used by the statement to separate each one of the variables, so that it can be put into the
correct variable?

yes and no.
If you look really close you'll see that the values are enclosed by single quotes (') and separated by commas

And why do you concatinate the string ie: "+edituser.text+" ?

Suppose the edituser field holds norman, editpassword contains bananas and popupsecuritygrp contains 123456

The resulting SQL, if you were to add this manually, needs to look like

insert into users (username, password, securitygrp) VALUES 'norman', 'bananas', '123456')

In order to achieve this you have to add the contents of each field, not the name

if you did

sql = "insert into users (username, password, securitygrp) VALUES ( edituser.text, editpassword.text, popupsecuritygrp.text )"

you would see that the result in the SQL variable is NOT what you need.
This is one reason I suggested putting the SQL into a variable that you could inspect before executing it. That way you can view the SQL and see if it is what you require.

When you use the statement I sent, you should see that it adds on the contents of each of those fields and not the name of each field.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to