PDA

View Full Version : Quickie on sqlite


dulux1309
03-24-2004, 09:56 AM
Hi all,

I am trying to get user input from input boxes and pass them into an sql database created using the sqlite plugin. I have tried every different syntax I can find to get the data into the database and have failed miserably. When I change the code to place real text in as opposed to the contents of the identifiers, it works.

Here is the code, if anyone can help... The database is created already...

--GET USER INPUTS#
Member_num = Input.GetText ("Input1");
first_name = Input.GetText ("Input2");
last_name = Input.GetText ("Input3");

--this works - proves that input boxes are working and data is being stored in variables..uncomment to use
--Debug.ShowWindow(true);
--Debug.Print(Member_num..' '..first_name..' '..last_name);

--OPEN HANDLE TO DATABASE AND ADD RECORD FROM FORM
--db = SQLite.Open("retain\\databases\\retain.db");
--SQLite.Query(db,"insert into MEMBERS values 'Member_num','first_name','last_name'");

--SQLite.Close(db);

-----------------------------------------------------code ends

Thanks, guys

Worm
03-24-2004, 10:14 AM
Give this a try...

SQLite.Query(db,"insert into Members values('" .. Member_num .."', '".. first_name .."', '".. last_name .."')");

dulux1309
03-24-2004, 10:22 AM
Thanks Worm!

It would appear that you are the man! I have a lot of learning to do on this project - both in AMS scripting and SQL, but with your help and the help of others on this forum, I'm sure I'll be flying along and helping others here before I know it.

Thanks again.