Thanks for that, Jesus. I have had a chance to try that now, but am 
still getting the same old error on the SQL part.

I have done this for On Click:

filtervalue=hk_thisform.get_pyvisible("NameInputField").value()
INSERT INTO People (Name) VALUES (filtervalue)

And I get the same error on line 2 now rather than line one. Again I 
have tried putting People, Name and filter value in single quotation 
marks, double quotation marks and a combination of that! Do I still 
misunderstand what you mean?

Cheers,

Rob

Jesus Arocho wrote:
> You cannot reference the lineeditfields directly.  You must first write code 
> to get the value within the field and then create the SQL statement with 
> those values.  The values can be assigned to a variable or incorporate the 
> code within the SQL statement.  I prefer the first approach.
>
> Something like below will assign the value of a combobox to the variable 
> filtervalue:
>
> #cbograde is a combo box outside on the grid object
> filtervalue=hk_thisform.get_pyvisible("cbograde").value()
>
>
> On Sunday 06 January 2008 19:53:41 Robert Wood wrote:
>   
>> Hi all,
>>
>> I am having my first go at databases, have been playing with Knoda for a
>> few days now and not got very far, although am learning a lot about how
>> databases work in general.
>>
>> I want to have a form and write data from a form to table; I have set up
>> a very basic test table called People which has three fields: ID, which
>> is auto increment, Name which is text and Telephone which is text. (All
>> very Mickey Mouse for the moment.) I have then made a little form with
>> two lineeditfields and one button. The lineeditfields are called
>> NameInputField and TelephoneInputField.
>>
>> I clicked on the button I placed on the form, and clicked on "On Click"
>> which opened up the little edit box and - with some help from my brother
>> who's done lots of SQL - I put the following:
>>
>> INSERT INTO People (Name,Telephone) VALUES (NameInputField,
>> TelephoneInputField)
>>
>> Now, I have seen a reference to SQL in the help files saying you have to
>> use double quotation marks, so I tried this:
>>
>> INSERT INTO "People" ("Name","Telephone") VALUES ("NameInputField",
>> "TelephoneInputField")
>>
>> I also tried single quotation marks, and only put the quotation marks as
>> so: ("Name,Telephone").
>>
>> In all instances I get this error:
>>
>> Line 1: Invalid Syntax  (<string>, line 1) and it opens up the edit box
>> with the SQL in it...
>>
>> It's flummoxed my brother as well (who is in a different country and
>> trying to debug via Yahoo), so we must be missing some fundamental point
>> here. I'd be very grateful for a point in the right direction/
>>
>> Cheers,
>>
>> Rob.
>>
>>
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2005.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Hk-classes-discuss mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/hk-classes-discuss
>>     
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Hk-classes-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hk-classes-discuss
>
>
>   


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Hk-classes-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hk-classes-discuss

Reply via email to