UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Datetime2 And Ado .getrows, SQL Server 2012    
 
   
tohas
post Apr 9 2020, 12:50 PM
Post#1



Posts: 93
Joined: 9-July 10



Hi,


I am using .GetRows to retrieve an array
the code is working

QUOTE
Dim cn As New ADODB.Connection
120 With cn
130 '.Provider = "SQLOLEDB.1"
.Provider = "SQLNCLI11"
140 .Properties("Data Source") = strSqlServer
..

Dim rs As New ADODB.Recordset
210 With rs
..
300 VRs = .GetRows


but now there are some linked mssql 2016 tables with two datetime2 fileds at the end (no option to change to datetime)

But .getrows ignores the datetime2 columns


Is there any working ado provider for mssql server?

Thanks
This post has been edited by tohas: Apr 9 2020, 12:51 PM
Go to the top of the page
 
cheekybuddha
post Apr 9 2020, 04:09 PM
Post#2


UtterAccess Moderator
Posts: 12,804
Joined: 6-December 03
From: Telegraph Hill


Hi,

You can try the ODBC driver

I'm fairly certain it supports DATETIME2

hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 
tohas
post Apr 10 2020, 06:16 AM
Post#3



Posts: 93
Joined: 9-July 10



thanks,

but could you please explain with a little code example

how to use an ODBC driver with ADO?

I thought I need an OLEDB provider for ADO.

Regards Thomas
This post has been edited by tohas: Apr 10 2020, 06:16 AM
Go to the top of the page
 
cheekybuddha
post Apr 10 2020, 06:31 AM
Post#4


UtterAccess Moderator
Posts: 12,804
Joined: 6-December 03
From: Telegraph Hill


Hi Thomas,

Once you have installed the driver, you should be able to use:
CODE
      Dim cn As New ADODB.Connection
120   With cn
135     .Provider = "ODBC Driver 17 for SQL Server"
140     .Properties("Data Source") = strSqlServer
' ...


hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 
tohas
post Apr 10 2020, 07:19 AM
Post#5



Posts: 93
Joined: 9-July 10



thanks
Go to the top of the page
 
tohas
post Apr 10 2020, 11:28 AM
Post#6



Posts: 93
Joined: 9-July 10



OK, my fault

All is working.

the datetime2 coulumns were hidden columns.

I overlooked this as I altered the table definition.

OMG
Go to the top of the page
 
cheekybuddha
post Apr 10 2020, 11:30 AM
Post#7


UtterAccess Moderator
Posts: 12,804
Joined: 6-December 03
From: Telegraph Hill


ohyeah.gif

Glad you figured it out! Thanks for the update.

Good luck with your project!

thumbup.gif

d

--------------------


Regards,

David Marten
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    25th May 2020 - 06:44 PM