?
Solved

DevExpress Scheduler

Posted on 2006-11-15
13
Medium Priority
?
1,868 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 2000 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
 

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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month15 days, left to enroll

771 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