Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DevExpress Scheduler

Posted on 2006-11-15
13
Medium Priority
?
1,873 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

597 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