Hi.
I'm using the driver version 6.0.1. I have some fields in SQL Server 2008 database of type date, that are mapped for TWideString, and not for TDateTime.
In my project, I'm using TSQLConnection, and I've already used sqlncli10.dll, sqlncli.dll, sqlncli10.dll and sqloledb.dll in VendorLib property.
Mapping date field
Re: Mapping date field
Hello,
This problem is caused by the OLEDB provider. The OLEDB provider returns DATE columns in the string format. To solve the problem, you should use SQL Native Client provider. For this, you should set the TSQLConnection.VendorLib property to sqlncli.dll . If you have persistent fields in datasets work with DATE columns, you should recreate persistent fields in these datasets. After this, all DATE columns will be mapped to TDateField.
This problem is caused by the OLEDB provider. The OLEDB provider returns DATE columns in the string format. To solve the problem, you should use SQL Native Client provider. For this, you should set the TSQLConnection.VendorLib property to sqlncli.dll . If you have persistent fields in datasets work with DATE columns, you should recreate persistent fields in these datasets. After this, all DATE columns will be mapped to TDateField.
-
- Posts: 3
- Joined: Thu 20 Dec 2012 11:03
Re: Mapping date field
AndreyZ,
I used sqlncli.dll in VendorLib property, but not work. In my machine I've installed MS SQL Server 2008 R2 with Native Client sqlncli10.dll version 10.50.2500.0.
Configuration used in Delphi XE3:
What Am I doing wrong and what is the issue?
I used sqlncli.dll in VendorLib property, but not work. In my machine I've installed MS SQL Server 2008 R2 with Native Client sqlncli10.dll version 10.50.2500.0.
Configuration used in Delphi XE3:
Code: Select all
with SQLConnection do
begin
DriverName := 'DevartSQLServer';
GetDriverFunc := 'getSQLDriverSQLServer';
LibraryName := 'dbexpsda40.dll';
VendorLib := 'sqlncli.dll';
Params.Values['DriverName'] := 'DevartSQLServer';
Params.Values['Database'] := Copy(sDataBase, Pos(':', sDataBase) + 1, Length(sDataBase) - Pos(':', sDataBase));
Params.Values['HostName'] := Copy(sDataBase, 1, Pos(':', sDataBase) - 1);
Params.Values['User_Name'] := Usuario;
Params.Values['Password'] := Senha;
Params.Values['IsolationLevel'] := 'DirtyRead';
end;
Re: Mapping date field
In RAD Studio XE3, you should specify VendorLib in the connection parameters. Here is a code example:
For more information about such behaviour, please consult with Embarcadero developers.
Code: Select all
SQLConnection.Params.Values['VendorLib'] := 'sqlncli.dll';
-
- Posts: 3
- Joined: Thu 20 Dec 2012 11:03
Re: Mapping date field
AndreyZ, thank you.
The problem was solved.
The problem was solved.
Re: Mapping date field
I am glad I could help. If any other questions come up, please contact us.