I found out that although MySQL stores dates in the YYYY-MM-DD format, you cannot give a record with the date in that format to the database using NB DBP. The app will generate an error saying 'your entry' is not a valid date.
If you add the date using M/D/YYYY format, the database will accept it and store it in the YYYY-MM-DD format. My test uses the MySQL ODBC connection downloaded from Oracle.
Defining the variable as a date in Neobook does not solve the issue. It appears that when you attempt to input ANY number into an entry field once the variable is defined as a date, you get an error after the first character example: "1" is not a valid date value
Copy the code below into a new 320x200 publication to test this error.
- Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5.80
ObjectType=9
Name=TextEntry1
X=53
Y=36
W=232
H=38
Anchor=0
VarName=[TextEntry1]
Align=1
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
Font=Arial
FontSize=9
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2
ObjectType=3
Name=PushButton2
X=288
Y=42
W=27
H=28
Anchor=0
Text=X
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=setvar "[textentry1]" ""
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
Font=Arial
FontSize=9
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=4
ObjectType=8
Name=Text1
X=10
Y=92
W=308
H=74
Anchor=0
Font=Arial
FontSize=9
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 1. type in a date in the field above in any formt. \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 2. Click X to remove entry\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 3. \plain\f0\fs18\cf0\uldb click here \plain\f0\fs18\cf0\v DefineVar "[TextEntry1]" "Date" "" "Global" ""\plain\f0\fs18\cf0 to define the variable used in the text entry\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 4. type any key into the field.}}}
HMargin=3
VMargin=2
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=5