pillsbur
2009-07-16T20:45:00Z
Hi,

I am testing the demo version for connections between Outlook 2003 and MySQL for calendar appointments. I don't understand why new items are being inserted into the database when I update an appointment in Outlook and then click "Store item". Why isn't the existing appointment simply updated?

I have a primary key set-up in the Genius Connect configuration: select (max(event_id) + 1) from classroom_1 but maybe that's not relevant to this problem?

What am I missing?

Thanks,
Glenn
Sponsor
GeniusConnect documentation search (User Manual Downloads...)
Administrator
2009-07-16T20:51:00Z
The SQL statement looks ok.

What is the value of Identity column (Assign Table->Mandatory Keys)?, it should be "No" in your case

pillsbur
2009-07-16T20:59:00Z
I just now set the Identity column to "No" but it's still creating new items. In my MySQL table, the event_id column is already set as primary and auto-increment. Does that matter?
Administrator
2009-07-16T21:07:00Z
Yes it does!
GeniusConnect runs your SQL Statement, and the result value will be inserted in DB, if your database uses a different (auto-increment) value, GeniusConnect is using WRONG VALUE.


If your database generates the primary key during the insert: Set the Identity column to Yes, and provide GeniusConnect with a SQL Statment to retrieve the last generated prim.key value. Dependent on your db version it should be select @@IDENTITY
pillsbur
2009-07-16T21:18:00Z
Ah. Ok.

I modified the SQL statement to just "select max(event_id) from classroom_1" and that seems to have fixed the issue.

Thanks!
Administrator
2009-07-16T21:25:00Z
If your prim.key DB column is auto.increment "select max(event_id) from classroom_1" will not always work! Please read documentation of your DB and GeniusConnect.
pillsbur
2009-07-16T22:38:00Z
When won't MAX work? I can't find anything warning against using it in the GeniusConnect online docs. I also can't think of a situation where it would break something. What did you have in mind?

Maybe you were thinking of COUNT? That one would break in some cases.
Administrator
2009-07-20T11:42:00Z
You database is generating prim.key values, select max(event_id) will work only if GeniusConnect is the only process inserting records to your DB, if an other process inserts an record at the same time, GeniusConnect will get a wrong value.
pillsbur
2009-07-20T17:46:00Z
Thanks for the clarification. Yes, GeniusConnect is the only process inserting records into this table, so we should be ok.