Board index » delphi » D2/MSSQL6/WinNT351/Datetimes

D2/MSSQL6/WinNT351/Datetimes

Hi.

This is a followup on a previous article.

The problem we had was that dates accepted by Delphi were rejected by the
MSSQL Server as being invalid, when accessing datetime columns through a
TTable and SQL Links.

We found out that this problem occurs only when our client program is
running on our Windows NT 3.51 server (the same machine that runs MSSQL6).
It does not occur if the client is running on a Windows 95 machine.

We did try to adjust the DATE MODE and SQLQUERYMODE parameters, but to no
avail.

By the way, the problem does not occur when using a TTable or using ODBC
instead of SQL Links.

Any ideas?

Thanks.

Bye.
--
Robert Gagnon | "Marketing:  The Art of Using the Truth to fool the  
              | consumers."
LONAS Informatique, 3395 Picard, St-Hyacinthe (QC) J2S 1H3 Fax:
(514)774-5160
lo...@maska.net   |   Opinions expressed are my own   |    Tel:
(514)778-2288

 

Re:D2/MSSQL6/WinNT351/Datetimes


Quote
"Robert Gagnon" <lo...@maska.net> wrote:
>Hi.
>This is a followup on a previous article.
>The problem we had was that dates accepted by Delphi were rejected by the
>MSSQL Server as being invalid, when accessing datetime columns through a
>TTable and SQL Links.
>We found out that this problem occurs only when our client program is
>running on our Windows NT 3.51 server (the same machine that runs MSSQL6).
>It does not occur if the client is running on a Windows 95 machine.
>We did try to adjust the DATE MODE and SQLQUERYMODE parameters, but to no
>avail.
>By the way, the problem does not occur when using a TTable or using ODBC
>instead of SQL Links.
>Any ideas?
>Thanks.
>Bye.
>--
>Robert Gagnon | "Marketing:  The Art of Using the Truth to fool the  
>              | consumers."
>LONAS Informatique, 3395 Picard, St-Hyacinthe (QC) J2S 1H3 Fax:
>(514)774-5160
>lo...@maska.net   |   Opinions expressed are my own   |    Tel:
>(514)778-2288

Hello Robert.
About two months ago, i went nuts with a problem similar to yours.
i am using delphi c/s 2.0 and SQL server 6.0 to develop an application
to store large amounts of data (multi million rows). it runs a bit
slow (with the 32 bit SQL links drivers) but i would like to see a
system as complex as our's running faster... Enough of the chat..
I was developing the system in the same machine (a 133 pentium with a
4 Gb Quantum Grand Prix hard disk and 64 mb of RAM). It was running NT
3.51 Delphi c/s 2.0 and MS SQL Server 6.0. Everything (well not
everything) was running fine until I tried to insert some rows from
delphi to SQL. SQL said it could not convert char type data to
datetime data. I had some tables with datetime fields and were those
fields the ones who didnt like delphi. If i read those fields (with a
ttable or a tquery) and then try to post again without modying then i
got the same error. hey wait... sometimes it runs... i have discovered
that when i try to post a date to SQL server whose month's first 3
letter are the same in spanish and in english, it runs well.
for example:
JANuary, ENEro->NOT runs
FEBruary, FEBrero->runs OK
MARch, MARzo->runs OK
APRil, ABRil-> NOT runs
......
I cant understand this because in my program I use dates with the
format 'dd/mm/yy' and not 'dd mmm yyy' (23 jan 1996).
And now for the solution...
in the internatinal settings of control panel you can specify (i i
remenber well) your country, your language and your keyboard layout.
You must put your language to US English (i think its the same
language tha's installed by SQL server) and now it should run fine.
I hope this helps
Sorry for my bad english
Santiago Belaustegui
san...@redestb.es

Re:D2/MSSQL6/WinNT351/Datetimes


In article <4q1608$...@artemis.ibernet.es>, san...@redestb.es says...

Quote

>"Robert Gagnon" <lo...@maska.net> wrote:

>>Hi.

>>This is a followup on a previous article.

>>The problem we had was that dates accepted by Delphi were rejected by
the
>>MSSQL Server as being invalid, when accessing datetime columns through
a
>>TTable and SQL Links.

>>We found out that this problem occurs only when our client program is
>>running on our Windows NT 3.51 server (the same machine that runs
MSSQL6).
>>It does not occur if the client is running on a Windows 95 machine.

>>We did try to adjust the DATE MODE and SQLQUERYMODE parameters, but to
no
>>avail.

>>By the way, the problem does not occur when using a TTable or using
ODBC
>>instead of SQL Links.

>>Any ideas?

>>Thanks.

>>Bye.
>>--
>>Robert Gagnon | "Marketing:  The Art of Using the Truth to fool the  
>>              | consumers."
>>LONAS Informatique, 3395 Picard, St-Hyacinthe (QC) J2S 1H3 Fax:
>>(514)774-5160
>>lo...@maska.net   |   Opinions expressed are my own   |    Tel:
>>(514)778-2288

>Hello Robert.
>About two months ago, i went nuts with a problem similar to yours.
>i am using delphi c/s 2.0 and SQL server 6.0 to develop an application
>to store large amounts of data (multi million rows). it runs a bit
>slow (with the 32 bit SQL links drivers) but i would like to see a
>system as complex as our's running faster... Enough of the chat..
>I was developing the system in the same machine (a 133 pentium with a
>4 Gb Quantum Grand Prix hard disk and 64 mb of RAM). It was running NT
>3.51 Delphi c/s 2.0 and MS SQL Server 6.0. Everything (well not
>everything) was running fine until I tried to insert some rows from
>delphi to SQL. SQL said it could not convert char type data to
>datetime data. I had some tables with datetime fields and were those
>fields the ones who didnt like delphi. If i read those fields (with a
>ttable or a tquery) and then try to post again without modying then i
>got the same error. hey wait... sometimes it runs... i have discovered
>that when i try to post a date to SQL server whose month's first 3
>letter are the same in spanish and in english, it runs well.
>for example:
>JANuary, ENEro->NOT runs
>FEBruary, FEBrero->runs OK
>MARch, MARzo->runs OK
>APRil, ABRil-> NOT runs
>......
>I cant understand this because in my program I use dates with the
>format 'dd/mm/yy' and not 'dd mmm yyy' (23 jan 1996).
>And now for the solution...
>in the internatinal settings of control panel you can specify (i i
>remenber well) your country, your language and your keyboard layout.
>You must put your language to US English (i think its the same
>language tha's installed by SQL server) and now it should run fine.
>I hope this helps
>Sorry for my bad english
>Santiago Belaustegui
>san...@redestb.es

Another place to "fix" datetimes in an international environment is in
the client configuration utility.  In the db-library section there is a
check box which defaults to "Use International Settings".  Uncheck this.
With this box checked the client software uses NT routines for datetime
conversion.  When unchecked, the client software uses DB-Lib routines.  
For non-english versions of NT the conversion routines are not always
compatible with SQL Server.

Good Luck

--
David Upham
Nan Pao Information Systems, Inc.
Phone:  886-2-816-5511 ext. 35
Fax:    886-2-813-2111
E-Mail: n...@ms1.hinet.net

Other Threads