Re: How do I add option ZERO_DATE_TO_MIN in mysql connector?
- From: Jochen Riekhof <nospam@xxxxxxxxxx>
- Date: Tue, 02 Dec 2008 16:39:24 +0100
Hi Ming...
> For 1, it seems that you can set the value in the "Option" textbox in > GUI, if you are using Windows platform.
unfortunately there is no option textbox but a huge amount of check boxes to build the option attribute. While I generally like the approach the ZERO_DATE_TO_MIN checkbox is unfortunately absent.
> For 2, it seems that we can use a connection string like "DSN=UserDSN;
> Option=16777216" (see the above link)
This is great, at least as a quick fix. I guess this will override any options set by the checkboxes in the DSN construction dialog (here: inside UserDSN) so it might be dangerous.
May be you know a way to get the DSN-less connection string from a DSN? When I would have this I could look up the options and just add to them in case ZERO_DATE_TO_MIN is absent.
Thank you for you assistance, the Options override possibility is certainly useful for me!
Ciao
....Jochen
Pak-Ming Cheung [MSFT] schrieb:
Sorry that I misunderstood your question..
For 1, it seems that you can set the value in the "Option" textbox in some GUI, if you are using Windows platform.
(see ftp://ftp.uoi.gr/pub/databases/mysql/doc/refman/5.1/en/myodbc-configuration-connection-parameters.html)
For 2, it seems that we can use a connection string like "DSN=UserDSN; Option=16777216" (see the above link)
Thanks,
Ming.
MDAC team, Microsoft.
"Jochen Riekhof" wrote:
Hi...
thank you for your answer, Pak-Ming! Unfortunatley it is not related to my problem. The problem is that when setting up the DSN in the mysql ODBC dialog I cannot specify the option FLAG_ZERO_DATE_TO_MIN (16777216).
With a DSN-less connection string I could specify it with adding OPTION=16777216 to it, but most of my customers would like to use preconfigured DSNs just the way you described it ("... ODBC DM will then prompt a dialog to allow users to select a DSN at runtime. ...").
What i wuld need would be
1. A way to specify above option somehow in the mysql ODBC dialog
2. a way to add an option value to an existing DSN chosen by the user (e.g some connection string like DSN=UserDSN;OPTION_ADDON=16777216)
2. a way to get the corresponding DNS-less connection string of a given DSN name, this way I could add the option myself by parsing the connection string and adding the option if necessary.
While 1. is really a question for the guys that developed the mysql ODBC Connnectors 2. and/or 3. could be something that is possible but I could not find info on it. Maybe you know some possibility?
Ciao
....Jochen
Pak-Ming Cheung [MSFT] schrieb:Yes, i think you can use "DSN=abc" as your connection string.
The keyword "DSN" is generic, which means all ODBC drivers should support it.
For more detail, see:
SQLDriverConnect: http://msdn.microsoft.com/en-us/library/ms715433.aspx
================================================
btw, if you would like to allow your customers to select a DSN, you may use SQLDriverConnect( SQL_DRIVER_PROMPT ) with an empty string as its connection string. ODBC DM will then prompt a dialog to allow users to select a DSN at runtime.
You may download the MDAC SDK from MSDN and test the effect with ODBC Test (a tool in SDK):
http://www.microsoft.com/downloads/details.aspx?familyid=5067faf8-0db4-429a-b502-de4329c8c850&displaylang=en
Thanks,
Ming.
MDAC Team, Microsoft.
"Jochen Riekhof" wrote:
Hi...
using mysql databases with zero (00-00-0000) dates caused many problems in ADO (2.x) via both ODBC/Connector 3.51 and 5.1. Fortunately I found the option FLAG_ZERO_DATE_TO_MIN (16777216) which solves all such problems.
The remaining issue now is that while the ODBC/Connector docs say there is a DSN option for this I was not able to find it in all the checkboxes of the ODBC DSN setup dialog. Is it there and I do not see it?
It would be very inconvenient for my customers to always use DSN-less connection strings so this is quite important for me.
If it is not possible to set this option in the DSN setup dialog, can options be added to the DSN connection string (e.g. DSN=mysqldb) somehow?
If this is not possible as well, is it at least possible to construct a direct (DSN-less) connection string form a given DSN name with some odbc API function?
Thank you for any hints on this!
Ciao
....Jochen
- Follow-Ups:
- Re: How do I add option ZERO_DATE_TO_MIN in mysql connector?
- From: Pak-Ming Cheung [MSFT]
- Re: How do I add option ZERO_DATE_TO_MIN in mysql connector?
- Next by Date: Re: How do I add option ZERO_DATE_TO_MIN in mysql connector?
- Next by thread: Re: How do I add option ZERO_DATE_TO_MIN in mysql connector?
- Index(es):
Relevant Pages
|