LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change this connection string for SQL Server 2012 ?

sprintf(szConnStr, "Server=%s;Database=%s;Provider=SQLXMLOLEDB.3.0;"
"Data Provider=SQLOLEDB;Initial Catalog=%s", pszSvrName, pszDb,pszDb);

 

I got error -2147352567 when call ADODB_ConnectionOpen.

 

TIA

 

 

George Zou
0 Kudos
Message 1 of 4
(3,357 Views)

Hi Zou,

 

Can you post any more context? If this is occurring in CVI with an ActiveX control, this knowledgebase article may be relevant:

 

Why Do I Get Error -2147352567 When Opening a VI Using Active-X in LabVIEW

http://digital.ni.com/public.nsf/allkb/7BB7805980B62383862572BA00568D5E?OpenDocument

 

If you could post code or clarify where this function call is being used, we may be able to get a better idea of what's causing the error.

Austin
Staff Software Engineer
NI
0 Kudos
Message 2 of 4
(3,319 Views)

Thanks for reply.

I'm using CVI, not LabVIEW.  So there is no VI ref.

ADODB_ConnectionOpen is inside ADO_Driver.fp

Before I call this function, I called ADODB_New_Connection.

No error, and the return ref is a valid number.

 

I think the problem is missing ADO component.

Don't know where I can get one compatible with Windows 2012 Server.

 

 

George Zou
0 Kudos
Message 3 of 4
(3,310 Views)

Hello George,

 

Is this helpful?

 

Microsoft ADO.NET for SQL Server

https://docs.microsoft.com/en-us/sql/connect/ado-net/microsoft-ado-net-for-sql-server

 

This is the best thing I could find for an ADO .NET driver.

Austin
Staff Software Engineer
NI
0 Kudos
Message 4 of 4
(3,291 Views)