1. Jahyd Chubbs
  2. PowerBuilder
  3. Wednesday, 28 August 2024 21:46 PM UTC

We are in the process of moving our application from an ODBC to OLE DB connection to our SQL Server database. We are having issues with the fact that OLE DB seems to be more strict with its datatypes.

For example, I have a time variable that is attempting to insert into a datetime column in the database. Previously with ODBC it would insert 1900-01-01+time. Now every place this is occurring is throwing an error about mismatched datatypes. We have been fixing these occurrences as they appear but wondering if there is a way to globally fix the issue in the connection parameters. 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 28 August 2024 23:08 PM UTC
  2. PowerBuilder
  3. # 1

Hi Jayhd;

  I would recommend that you move to the latest Microsoft SS DB Client called "MSOLEDBSQL" as this is MS's stated direction for SQL Server 2016 & higher going forward. MS has deprecated SNC & OLE-DB DB clients. Food for thought.

Regards ... Chris 

Comment
  1. mike S
  2. Thursday, 29 August 2024 15:28 PM UTC
"OLE DB client"

the one great thing about oledb client is that it is/was included in all windows OS installs by default. Not sure 100% about 11, but i think it may be in there too.
  1. Helpful
  1. Jahyd Chubbs
  2. Tuesday, 3 September 2024 11:13 AM UTC
Thank you for your response. We are using MSOLEDBSQL but the problem we are having with it is the errors we are getting about mismatched datatypes. We have many cases of time variables being inserted into a datetime SQL column that are throwing errors now that weren't before using ODBC. We are wondering if there is a way to correct this globally instead of on a case by case basis. Sorry if my post wasn't clear.
  1. Helpful
  1. mike S
  2. Tuesday, 3 September 2024 12:05 PM UTC
You probably need to find out from microsoft since it is their driver. My guess is that microsoft at that time allowed that code to work because they did not have a time datatype in the database. now they do, so they won't allow that kind of mismatch.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.