Home » U++ Library support » U++ SQL » size of S_XXX struct members
size of S_XXX struct members [message #41560] |
Mon, 30 December 2013 15:53 |
|
Alboni
Messages: 214 Registered: January 2012 Location: Deventer, Netherlands
|
Experienced Member |
|
|
I problem im running into a lot is users entering strings that are longer than defined in the sql tables.
for example if I have a .sch file like
TABLE_ (PAYMENT_METHOD)
INT_ (PM_ID) PRIMARY_KEY UNIQUE AUTO_INCREMENT
STRING_ (PM_DESCRIPTION, 30)
END_TABLE
and a user enters a description of 35 characters, then the sql insert fails with an errormessage that the value for PM_DESCRIPTION is too long.
I know I can use EditString::MaxLen(30) to limit the input, but that means entering the length of the field in 2 places.
So, can I do something like:
dialog.pm_description.MaxLen(sizeof(S_PAYMENT_METHOD::PM_DESCRIPTION));
dialog.pm_description being the EditString for editing the field
for editing PM_DESCRIPTION in the PAYMENT_METHOD table.
I know sizeof() won't work here, but what will?
[Updated on: Mon, 30 December 2013 15:56] Report message to a moderator
|
|
|
|
|
size of S_XXX struct members
By: Alboni on Mon, 30 December 2013 15:53
|
|
|
Re: size of S_XXX struct members
By: mirek on Mon, 06 January 2014 16:06
|
|
|
Re: size of S_XXX struct members
By: Didier on Mon, 06 January 2014 19:28
|
|
|
Re: size of S_XXX struct members
By: Alboni on Tue, 07 January 2014 22:53
|
|
|
Re: size of S_XXX struct members
By: mirek on Wed, 08 January 2014 12:05
|
|
|
Re: size of S_XXX struct members
By: mirek on Fri, 10 January 2014 14:42
|
|
|
Re: size of S_XXX struct members
By: Alboni on Fri, 10 January 2014 14:48
|
|
|
Re: size of S_XXX struct members
By: Alboni on Fri, 10 January 2014 14:57
|
|
|
Re: size of S_XXX struct members
By: mirek on Fri, 10 January 2014 15:35
|
|
|
Re: size of S_XXX struct members
By: Alboni on Tue, 28 January 2014 14:34
|
|
|
Re: size of S_XXX struct members
By: mirek on Tue, 28 January 2014 20:13
|
Goto Forum:
Current Time: Sat May 04 12:23:04 CEST 2024
Total time taken to generate the page: 0.02143 seconds
|