Solved

DevExpress Scheduler

Posted on 2006-11-15
13
1,842 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:ciuly
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:ciuly
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:
ciuly 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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:ciuly
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:ciuly
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

760 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

23 Experts available now in Live!

Get 1:1 Help Now