DevExpress Scheduler

Hi there,
I am tryting to use DevExpress Scheduler and DBStroge to keep all data on my MySQL server.But when I try to add an event it triggers
[1064]#42000You have an error in your SQL syntax, blah blah. near 'ParentID=NULL,`Type`=0,Start=`2006-11-15 00:00:00'

and the table struc. is
CREATE TABLE `reminder` (
  `ID` int(11) NOT NULL,
  `ParentID` int(11) default '0',
  `Type` int(11) default NULL,
  `Start` timestamp NULL default NULL,
  `Finish` timestamp NULL default NULL,
  `Options` int(11) default NULL,
  `Caption` varchar(255) collate latin1_general_ci default NULL,
  `RecurrenceIndex` int(11) default NULL,
  `RecurrenceInfo` blob,
  `ResourceID` blob,
  `Location` varchar(255) collate latin1_general_ci default NULL,
  `Message` varchar(255) collate latin1_general_ci default NULL,
  `ReminderDate` timestamp NULL default NULL,
  `ReminderMinutes` int(11) default NULL,
  `State` int(11) default NULL,
  `LabelColor` int(11) default NULL,
  `ActualStart` timestamp NULL default NULL,
  `ActualFinish` timestamp NULL default NULL,
  `SyncIDField` varchar(255) collate latin1_general_ci default NULL,
  `userID` int(11) default NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

can anyone help me out here?
bilgehanyildirimAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
2266180Connect With a Mentor Commented:
>I removed 'Allow Null' from the table definition of ParentID a
you still didn't do the test where you actually set a value for parent id. if the error message is the same, then parentid is still reported as null.
0
 
2266180Commented:
sure.
ParentID=NULL,`Type`=0,
remove the ` from around Type
0
 
bilgehanyildirimAuthor Commented:
I don't create SQL, I think component creates itself.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
2266180Commented:
hm... in that case I would go for the first possible issue: Type is a reserved word. but this should have been an error when creating the table, so this drops.
next would be that you set parentid to null which in some db's is not accepted for an integer; don't know about mysql though
and the most possible thing is that ID is missing (at least in what you pointed out) and you must set a value for it since it cannot be null.

so I would go bu checking that ID is set, then making sure that you are setting a valid number for parentid, then to check the db from mysql server itself and see that indeed it has a type column.
if everything is ok and you still get the same error, then try running the sql query yourself from command line or some other DB tool (like dbvisualizer) and see if you still get the error (this is to see if the components are making the issue)
0
 
bilgehanyildirimAuthor Commented:
Hi Ciuly,
I changed the fieldname to EventType and retried.This time the ` is removed from the error message I got. So, as you said Type is a reserved word but by putting `, it allows to use it as a field name.

I removed 'Allow Null' from the table definition of ParentID and added 'Auto Inc' to ID and still get the same error message.

I can see/edit the sql query because there is nowhere I can see it :)
0
 
bilgehanyildirimAuthor Commented:
>>>I can see/edit the sql query because there is nowhere I can see it :)
should be
I CANNOT see/edit the sql query because there is nowhere I can see it :)
0
 
bilgehanyildirimAuthor Commented:
After doing this
procedure TfrmMain.ssDBReminderEventModified(Sender: TObject;
  AEvent: TcxSchedulerEvent; var AHandled: Boolean);
begin
  Aevent.ParentID := '2';
end;

now error says
[1064]#42000You have an error in your SQL syntax, blah blah. near 'ParentID=2,`Type`=0,Start=`2006-11-15 00:00:00'
0
 
2266180Commented:
whats blah blah? does it have anything to do with: http://www.modwest.com/help/kb6-265.html ?
0
 
bilgehanyildirimAuthor Commented:
it is
check the manual that corresponds to your MySQL server version for the right syntax to use near'ParentID=2,EventType=0,Start='2006-11-15 00:00:00',Finish='
0
 
bilgehanyildirimAuthor Commented:
I don't think it is the SQL, I think I am doing something wrong with this component.
have you used this before?
0
 
2266180Commented:
no. sorry. but I'm sure someone who did will read up this question sooner or later ;)
0
 
Wim ten BrinkSelf-employed developerCommented:
I have used some of the DevExpress components for my previous employer but not this component. However, in my experience their components are quite nice, yet not 100% free of any bugs. So my suggestion would be to check the sourcecode of this component -if you have it- and see if you can step through it and detect the problem there. More importantly, try to get the complete SQL command that this component is generating.

Problem with DevExpress components are that they tend to be too smart sometimes doing just a bit too much. Or sometimes just not doing things the right way. Unfortunately my new employer isn't using these components so I can't check this for you but you might want to contact DevExpress suppport about this issue.
0
 
bilgehanyildirimAuthor Commented:
Ok, that's how I solved it.
Instead of Table, I used Query.

And for future references, if you use timestamp instead of datetime field type, reoccurences cause problem :)
Thanks for your helps!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.