tamnguyen Posted November 12, 2014 Share Posted November 12, 2014 Hi all! I create a GUI have 2 inputs, and a button "OK" and i create a database, and create a table that is named "MY_DATABASE". Now, i want to type value into input and then i click OK, i will have data in MY_DATABASE. This is my code! $data_ID = GUICtrlRead($input_ID) $data_Name = GUICtrlRead($input_name) _SQLite_Startup() _SQLite_Open($Name_Database) _SQLite_Exec(-1, "INSERT INTO MY_DATABASE ("& $data_ID &","& $data_Name &");") ;-------------- I type into input_ID: 9000 I type into input_Name: nguyenchitam when i click OK it have a error ! SQLite.au3 Error --> Function: _SQLite_Exec --> Query: INSERT INTO MY_DATABASE VALUES (9000,nguyenchitam); --> Error: no such column: nguyenchitam But when i type :I type into input_ID: 9000 I type into input_Name: 123 ---> IT's good and i have a data in MY_DATABASE Can anyone help me? I want to have a data with typedata is text Link to comment Share on other sites More sharing options...
Danp2 Posted November 12, 2014 Share Posted November 12, 2014 You should wrap the variable data in single quotes, ie: _SQLite_Exec(-1, "INSERT INTO MY_DATABASE ('"& $data_ID &"','"& $data_Name &"');") Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now