Welcome! Log In Create A New Profile

Advanced

[WD] OLEDB connect to SQL Server

Posted by Infoss 
Infoss
[WD] OLEDB connect to SQL Server
May 10, 2022 10:28AM
I want to connect my WinDev application to MS SQL server via OLEDB connect to SQL Server.
1. Is it necessary to specifically set up or install any auxiliary tools on the server or client computer?
2. When using OLEDB connectivity can I use standard WD commands HAdd, HModify etc. as I use with HFSQL

Thank you
pao
Re: [WD] OLEDB connect to SQL Server
May 10, 2022 10:45AM
To use HREAD*/HADD,... with SQL SERVER you need to buy and install the Native Access
[doc.windev.com]

PS:
My advice is with SQL SERVER use queries as mutch as you can instead of HREAD*

Regards

Paulo Oliveira



Edited 1 time(s). Last edit at 05/10/2022 10:47AM by pao.
Infoss
Re: [WD] OLEDB connect to SQL Server
May 10, 2022 12:25PM
I tried the connection
// Describe the new connection
HDescribeConnection("MyConnection", "", "", "Server_SQLServer", ...
 "dbo", hOledbSQLServer, hOReadWrite, "")
Every time he tells me the connection is wrong
pao
Re: [WD] OLEDB connect to SQL Server
May 10, 2022 01:30PM
I'm using this and it works:

wext is string="WD Connection Timeout = 600; WD Command Timeout=600"
IF NOT HDescribeConnection("MY_CONN","my_sql_user","password_sql_user","my_db_server","my_db",hOledbSQLServer,
hOReadWrite,wext) THEN
Error("Error in hdescribeconnexion - "+CR+ErrorInfo())
RETURN
END

IF NOT HOpenConnection("MY_CONN") THEN
Error("Error in HOpenConnection - "+CR+ErrorInfo())
RETURN
END
IF NOT HChangeConnection("*","MY_CONN") THEN
Error("Error in HChangeConnection - "+CR+ErrorInfo())
RETURN
END

Regards

Paulo Oliveira



Edited 1 time(s). Last edit at 05/10/2022 01:36PM by pao.
Infoss
Re: [WD] OLEDB connect to SQL Server
May 10, 2022 01:53PM
Thanks Paulo

Is it necessary to create an OLEDB connection in Project Analysis?
pao
Re: [WD] OLEDB connect to SQL Server
May 10, 2022 03:37PM
No, I use the same project and analisys for HF, MSSQL and ORACLE
That's why i use the HChangeConnection for every file in the analisys.

Did you check if the requirements to use OLE are installed?
[doc.windev.com]

Regards

Paulo Oliveira
pao
Re: [WD] OLEDB connect to SQL Server
May 10, 2022 03:47PM
This is the result of HLISTPROVIDER in my dev PC:
WinDevOracle - Native Oracle Access for WINDEV - WinDevOracle
WinDevSQLServer - Native SQL Server Access for WINDEV - WinDevSQLServer
WinDevSQLAzure - Native SQL Azure access for WINDEV - WinDevSQLAzure
WinDevXBase - Native xBase Access for WINDEV - WinDevXBase
WinDevXML - Native XML Access for WINDEV - WinDevXML
WinDevSQLite - Native SQLite Access for WINDEV - WinDevSQLite
]SQLOLEDB - Microsoft OLE DB Provider for SQL Server - SQLOLEDB]
IBMDASQL - IBM DB2 UDB for iSeries IBMDASQL OLE DB Provider - IBMDASQL
MSOLAP - Microsoft OLE DB Provider for Analysis Services 11.0 - MSOLAP
MSDataShape - MSDataShape - MSDataShape
SQLNCLI11 - SQL Server Native Client 11.0 - SQLNCLI11
Microsoft.ACE.OLEDB.12.0 - Microsoft Office 12.0 Access Database Engine OLE DB Provider - Microsoft.ACE.OLEDB.12.0
Microsoft.ACE.OLEDB.15.0 - Microsoft Office 15.0 Access Database Engine OLE DB Provider - Microsoft.ACE.OLEDB.15.0
ADsDSOObject - OLE DB Provider for Microsoft Directory Services - ADsDSOObject
IBMDA400 - IBM DB2 UDB for iSeries IBMDA400 OLE DB Provider - IBMDA400
MSOLEDBSQL - Microsoft OLE DB Driver for SQL Server - MSOLEDBSQL
Windows Search Data Source - Microsoft OLE DB Provider for Search - Windows Search Data Source
MSDASQL - Microsoft OLE DB Provider for ODBC Drivers - MSDASQL
MSOLAP - Microsoft OLE DB Provider for Analysis Services 14.0 - MSOLAP
Microsoft.Jet.OLEDB.4.0 - Microsoft Jet 4.0 OLE DB Provider - Microsoft.Jet.OLEDB.4.0
MSDAOSP - Microsoft OLE DB Simple Provider - MSDAOSP
IBMDARLA - IBM DB2 UDB for iSeries IBMDARLA OLE DB Provider - IBMDARLA
MSDAORA - Microsoft OLE DB Provider for Oracle - MSDAORA
Microsoft.Jet.OLEDB.3.51;Extended Properties=Excel 8.0; - MS Excel - Microsoft.Jet.OLEDB.3.51;Extended Properties=Excel 8.0;
Microsoft.Jet.OLEDB.3.51;Extended Properties=dBase III; - dBase III - Microsoft.Jet.OLEDB.3.51;Extended Properties=dBase III;
Microsoft.Jet.OLEDB.3.51;Extended Properties=dBase IV; - dBase IV - Microsoft.Jet.OLEDB.3.51;Extended Properties=dBase IV;
Microsoft.Jet.OLEDB.3.51;Extended Properties=dBase 5.0; - dBase 5.0 - Microsoft.Jet.OLEDB.3.51;Extended Properties=dBase 5.0;
Microsoft.Jet.OLEDB.3.51;Extended Properties=Lotus WK4; - Lotus - Microsoft.Jet.OLEDB.3.51;Extended Properties=Lotus WK4;
Microsoft.Jet.OLEDB.3.51;Extended Properties=Paradox 5.x; - Paradox - Microsoft.Jet.OLEDB.3.51;Extended Properties=Paradox 5.x;
Microsoft.Jet.OLEDB.3.51;Extended Properties=HTML Import; - HTML - Microsoft.Jet.OLEDB.3.51;Extended Properties=HTML Import;
Microsoft.Jet.OLEDB.3.51;Extended Properties=Exchange 4.0; - MS Exchange / Outlook - Microsoft.Jet.OLEDB.3.51;Extended Properties=Exchange 4.0;
WinDevClientServeurHF - HFSQL Client/Server access - WinDevClientServeurHF

Regards

Paulo Oliveira



Edited 1 time(s). Last edit at 05/10/2022 03:48PM by pao.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: