Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » SqlArray with an Option
SqlArray with an Option [message #54205] Sun, 07 June 2020 23:15 Go to next message
forlano is currently offline  forlano
Messages: 1105
Registered: March 2006
Location: Italy
Experienced Contributor
Hello,

I was doing experiment with SqlArray. Everything works with

	arr.SetTable(TUSERS);
	arr.AddKey(ID);
	arr.AddColumn(N, "N", 1);
	arr.AddColumn(NAME, "Name", 4);
	arr.AddColumn(CAPTAIN, "Captain",4);
	arr.AddColumn(EMAIL, "Email",4).Edit(edtEmail);
	arr.AddColumn(PASSWORD, "Password",4).Edit(edtPass);
	arr.SetOrderBy(N);
	arr.Query();


and I am able to edit and save automagically the fields EMAIL and PASSWORD. Then I wanted to add a column of Option so that the user can select the rows he needs to elaborate later at once on the DB. So I added a column with

        arr.SetTable(TUSERS);
	arr.AddKey(ID);
        arr.AddColumn("YN", "", 1).Ctrls<Option>();  //<============
        ...


and the compiler complained "YN" is not declared. So I added a dummy column in the database schema called YN and used

arr.AddColumn(YN, "", 1).Ctrls<Option>();

Now the Option appeared in each row on the left of the SqlArray, but the fields EMAIL and PASSWORD are no longer editable.
What am i missing? Is is possibile to have a column of Option in a SqlArray (I do not care to save in the database the value of the option).

Thanks,
Luigi
Re: SqlArray with an Option [message #54419 is a reply to message #54205] Wed, 15 July 2020 01:59 Go to previous message
mtdew3q is currently offline  mtdew3q
Messages: 172
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

Did you try sqlctrls ctrls or addctrl method of sqlarray ?
I notice when I am editing or inserting into db also control becomes active.
You can either right click on sqlarray and use acceptrow or like in postgres use library api for that db. I typed from my phone. Sorry if formatting is a bit off.
Thnx,
Roboloki
Previous Topic: sql session in a global variable?
Goto Forum:
  


Current Time: Wed Aug 12 04:57:50 CEST 2020

Total time taken to generate the page: 0.01586 seconds