Solved

DevExpress Scheduler

Posted on 2006-11-15
13
1,849 Views
Last Modified: 2012-06-21
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?
0
Comment
Question by:bilgehanyildirim
  • 7
  • 5
13 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 17945809
sure.
ParentID=NULL,`Type`=0,
remove the ` from around Type
0
 

Author Comment

by:bilgehanyildirim
ID: 17945828
I don't create SQL, I think component creates itself.
0
 
LVL 28

Expert Comment

by:2266180
ID: 17945853
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
 

Author Comment

by:bilgehanyildirim
ID: 17945894
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
 

Author Comment

by:bilgehanyildirim
ID: 17945899
>>>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
 
LVL 28

Accepted Solution

by:
2266180 earned 500 total points
ID: 17945966
>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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:bilgehanyildirim
ID: 17946008
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
 
LVL 28

Expert Comment

by:2266180
ID: 17946050
whats blah blah? does it have anything to do with: http://www.modwest.com/help/kb6-265.html ?
0
 

Author Comment

by:bilgehanyildirim
ID: 17946073
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
 

Author Comment

by:bilgehanyildirim
ID: 17946104
I don't think it is the SQL, I think I am doing something wrong with this component.
have you used this before?
0
 
LVL 28

Expert Comment

by:2266180
ID: 17946122
no. sorry. but I'm sure someone who did will read up this question sooner or later ;)
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 17946232
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
 

Author Comment

by:bilgehanyildirim
ID: 17947611
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now