Page 1 of 1
Deployment issue with UniDAC 3 for SQL Server
Posted: Mon 02 Aug 2010 09:10
by RickardEngberg
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?
Posted: Mon 02 Aug 2010 13:47
by Dimon
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';
Posted: Mon 02 Aug 2010 17:37
by RickardEngberg
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.
Posted: Tue 03 Aug 2010 02:25
by DepSoft
Posted: Tue 03 Aug 2010 08:37
by RickardEngberg
Yep, that did it. Thanks a lot!
Posted: Tue 03 Aug 2010 08:39
by Dimon
It is good to see that this problem has been solved.
Posted: Tue 03 Aug 2010 08:50
by RickardEngberg
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.
Posted: Tue 03 Aug 2010 12:14
by Dimon
The point is that standard OLEDB provider processes datetime fields only as string fields. Therefore you need to install the SQL Native Client provider.
Posted: Tue 03 Aug 2010 12:31
by RickardEngberg
I see. Then I will have the same problem using ODBC to connect to the database. One learns something every day
Many thanks yet again.