PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Connexion sql server avec Active Directory
Connexion sql server avec Active Directory
Débuté par BIZEC, 20 avr. 2018 13:13 - Aucune réponse
Posté le 20 avril 2018 - 13:13
Je dois passer d'une connexion qui utilisait les crédentials du serveur Microsoft SQL Server à une connexion SQL Server utilisant l' Active Directory

Avant j'utilisais :

Procedure Connexion()
sLogin est une chaîne = getLogin()
sPassword est une chaîne = getPassword()
sServer est une chaîne = getServer()
sBdd est une chaîne = getBDD()

NumConnexion est un entier
NumConnexion = SQLConnecte(sServer, sLogin, sPassword, sBdd, "OLEDB", hOledbSQLServer)
RENVOYER NumConnexion


Comment puis je ouvrir une connexion SQL Serveur en utilisant l' Active Directory ?

ResExec est un booléen
ResExec = SQLExec([
WITH demandes AS (
SELECT d.DemandeID, d.NumeroDemande, t.Libelle, de.LEID, d.DateImport, swd.DateModification ,sd.Libelle as libelleStatutDemande, sw.Libelle as libelleStatutWorkflow,
ROW_NUMBER() OVER(PARTITION BY d.DemandeID
ORDER BY swd.DateModification DESC) AS modif
FROM [PreprodOrangeFT].[dbo].[Demande] d
INNER JOIN [PreprodOrangeFT].[dbo].[TypeDemande] t ON d.TypeDemandeID = t.TypeDemandeID
INNER JOIN [PreprodOrangeFT].[dbo].[Demandeur] de ON d.DemandeurID = de.DemandeurID
INNER JOIN [PreprodOrangeFT].[dbo].StatutDemande sd ON d.StatutDemandeID = sd.StatutDemandeID
INNER JOIN [PreprodOrangeFT].[dbo].StatutWorkflowDemande swd ON d.DemandeID = swd.DemandeID
INNER JOIN [PreprodOrangeFT].[dbo].StatutWorkflow sw ON swd.StatutWorkflowID = sw.StatutWorkflowID)
select demandes.* from demandes
WHERE demandes.modif = 1
], idQ)
SI PAS ResExec ALORS
Erreur("Erreur d'initialisation de la requête" + RC + HErreurInfo())
SQLDéconnecte()
RETOUR
FIN