Deployment issue with UniDAC 3 for SQL Server

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
RickardEngberg
Posts: 13
Joined: Mon 12 Apr 2010 15:23

Deployment issue with UniDAC 3 for SQL Server

Post by RickardEngberg » Mon 02 Aug 2010 09:10

I have what I assume is a deployment issue with UniDAC 3 (both the previous version and the new build). On my development machine everything works fine, but when I install my app someplace else I get errors claiming that certain fields are the wrong type. For instance, a time field with the type DATETIME throws an exception claiming the database delivers a WIDESTRING field. It seems to connect allright though.

I use the exact same EXE connecting to the exact same database with the exact same user credentials. I get it on multiple PCs but not all I try it on.

I have only deployed my .EXE. Do I need to deploy any DLLs?

Anyone?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 02 Aug 2010 13:47

To map the DATE and TIME SQL Server types to TDateField and TTimeField you should use the SQL Native Client provider. For this set the Provider specific option to the prNativeClient value, like this:

Code: Select all

  UniConnection.SpecificOptions.Values['Provider'] := 'prNativeClient';

RickardEngberg
Posts: 13
Joined: Mon 12 Apr 2010 15:23

Post by RickardEngberg » Mon 02 Aug 2010 17:37

Ok, I had a look early on at the OLEDBProvider setting and set that to native client, but that didn't do anything. Doing what you suggest results in the message 'Required provider is not installed'. That too suggests I am lacking something on the client side. Do I need to install a client for SQL Server? I thought that was already in Windows.

DepSoft
Posts: 20
Joined: Tue 27 Jul 2010 03:01
Location: Western Australia

Post by DepSoft » Tue 03 Aug 2010 02:25

There are native client downloads on:

http://www.microsoft.com/downloads/deta ... laylang=en

Regards, Paul.

RickardEngberg
Posts: 13
Joined: Mon 12 Apr 2010 15:23

Post by RickardEngberg » Tue 03 Aug 2010 08:37

Yep, that did it. Thanks a lot!

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 03 Aug 2010 08:39

It is good to see that this problem has been solved.

RickardEngberg
Posts: 13
Joined: Mon 12 Apr 2010 15:23

Post by RickardEngberg » Tue 03 Aug 2010 08:50

A bit of follow up ponderings... Is there any way to deploy apps so they can connect to the database without having to install the native client? The reason I ask is that there is a chance people will want to install it on controlled environments such as standard business work plattforms where installing the native client won't be allowed.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 03 Aug 2010 12:14

The point is that standard OLEDB provider processes datetime fields only as string fields. Therefore you need to install the SQL Native Client provider.

RickardEngberg
Posts: 13
Joined: Mon 12 Apr 2010 15:23

Post by RickardEngberg » Tue 03 Aug 2010 12:31

I see. Then I will have the same problem using ODBC to connect to the database. One learns something every day :D

Many thanks yet again.

Post Reply