Re: How do I add option ZERO_DATE_TO_MIN in mysql connector?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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

.



Relevant Pages

  • Re: DSN-less connection for Informix database
    ... Pervasive ODBC client Interface ... ... on is having to SETUP an odbc connection profile .. ... what I did was created an ODBC System DSN ... ... in your connection string, replace the DNS=jaco ... ...
    (microsoft.public.dotnet.languages.vb)
  • RE: How do I add option ZERO_DATE_TO_MIN in mysql connector?
    ... i think you can use "DSN=abc" as your connection string. ... The keyword "DSN" is generic, which means all ODBC drivers should support it. ... It would be very inconvenient for my customers to always use DSN-less ...
    (microsoft.public.data.odbc)
  • Re: Create DSN Programmatically
    ... Referring to the connection string as a Data ... > Source Name (DSN) is a naming convention used to refer to the connection ... Only in the case of ODBC API ...
    (microsoft.public.vsnet.general)
  • Re: Trying to connect to MySQL db with DAO using ODBC
    ... the connection string I'm using is copied from the example in the ... I did as you suggested and created a DSN. ... works while the 'apparently' equivalent DSN-less connection string does not. ... your code set or add all the properties exactly as you see ...
    (microsoft.public.vb.database.dao)
  • Re: How do I add option ZERO_DATE_TO_MIN in mysql connector?
    ... With a DSN-less connection string I could specify it with adding ... prompt a dialog to allow users to select a DSN at runtime. ... A way to specify above option somehow in the mysql ODBC dialog ...
    (microsoft.public.data.odbc)