Board index » delphi » Solution: Errors while editing datefields on SQL-Server 6.5

Solution: Errors while editing datefields on SQL-Server 6.5

Several days ago i had problems in accessing datevalues from
delphi 2.0 on SQL-Server (both german versions). I got an errormessage
telling me that SQL-Server cannot convert the string to a date.

Exploring this problem whith the SQL-trace utility shows that the BDE
makes a SELECT COUNT(*) on the record that i want to edit in order to check
that this dataset is existing (could be deleted or changed by another
user).

If there is a datefield in the recordset then BDE writes in the WHERE
clause
.. DATUM='DEC 2 1998 00:00:00'. This resulted in an error because the
german
shortname for december is DEZ not DEC.

Any configuration of SQL-Server client or BDE or using
shortdateformat,longdateformat... did nothing change.

Now I found that on another PC with the same configuration anything is
running fine.

I checked anything til i found that I have 2 different datet DLL's from
the SQL-Server client in use.

These DLL's are NTWDBLIB.DLL and DBNMPNTW.DLL. It seems that there are some
Version that cannot be used together.
(I think the clientsetup / servicespacks do not correctly update the client

because i had different version in the directorys C:\MSSQL and
C:\WINDOWS\SYSTEM even after reinstalling the client)

The following Versions are working fine:

NTWDBLIB.DLL dated 16.04.1997 12:19
DBNMPNTW.DLL dated 02.04.1997 01:00

Now the WHERE clause generated by BDE looks
like ...DATUM='02.12.1998 00:00:00'

--
Thomas Friedmann
i.d.e.e. Beratungsges. mbH
106333,2...@compuserve.com

 

Re:Solution: Errors while editing datefields on SQL-Server 6.5


ATTENTION: latest news:

This is also valid for SQL-server itself.
I Uninstalled an english SQL-server and tried to install the german
version.
--> Install hangs while creating the MSDB.
--> Solution. remove manually the above mentioned DLL's from
     \WINNT\SYSTEM32 before!! attempting an new Installation.
     (Install uses ISQL that uses these DLL's)

Re:Solution: Errors while editing datefields on SQL-Server 6.5


Hi Tomas,
Respect to dates format in SQL-Server. I have a short path workaround.
In the Microsoft SQL Client configuration Utility uncheck
Use international settings and
Automatic ANSI to OEM too.

after this, your program (at creation state) must send the following sentence
to SQL-Server
"set dateformat ymd  "
where y stand for year, m = month and d= day.
The correct order of y,m,d depend of your country format.

I hope this help you

Charlie

Thomas Friedmann escribi:

Quote
> Several days ago i had problems in accessing datevalues from
> delphi 2.0 on SQL-Server (both german versions). I got an errormessage
> telling me that SQL-Server cannot convert the string to a date.

> Exploring this problem whith the SQL-trace utility shows that the BDE
> makes a SELECT COUNT(*) on the record that i want to edit in order to check
> that this dataset is existing (could be deleted or changed by another
> user).

> If there is a datefield in the recordset then BDE writes in the WHERE
> clause
> .. DATUM='DEC 2 1998 00:00:00'. This resulted in an error because the
> german
> shortname for december is DEZ not DEC.

> Any configuration of SQL-Server client or BDE or using
> shortdateformat,longdateformat... did nothing change.

> Now I found that on another PC with the same configuration anything is
> running fine.

> I checked anything til i found that I have 2 different datet DLL's from
> the SQL-Server client in use.

> These DLL's are NTWDBLIB.DLL and DBNMPNTW.DLL. It seems that there are some
> Version that cannot be used together.
> (I think the clientsetup / servicespacks do not correctly update the client

> because i had different version in the directorys C:\MSSQL and
> C:\WINDOWS\SYSTEM even after reinstalling the client)

> The following Versions are working fine:

> NTWDBLIB.DLL dated 16.04.1997 12:19
> DBNMPNTW.DLL dated 02.04.1997 01:00

> Now the WHERE clause generated by BDE looks
> like ...DATUM='02.12.1998 00:00:00'

> --
> Thomas Friedmann
> i.d.e.e. Beratungsges. mbH
> 106333,2...@compuserve.com

Other Threads