PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 24 → Conexão no PostgreSQl usando porta diferente (15432) em vez da porta padrão (5432)
Conexão no PostgreSQl usando porta diferente (15432) em vez da porta padrão (5432)
Débuté par Boller, 10 juil. 2020 19:12 - Aucune réponse
Membre enregistré
3 159 messages
Popularité : +89 (91 votes)
Posté le 10 juillet 2020 - 19:12
PROCEDURE ConexaoPostgreSQL()

ok1, ok2 is boolean

INIWrite("Config","HOST",EDT_Host,fCurrentDir()+"\Config.ini")
INIWrite("Config","PORT",EDT_Porta,fCurrentDir()+"\Config.ini")
INIWrite("Config","DBAS",EDT_DB,fCurrentDir()+"\Config.ini")
INIWrite("Config","USER",EDT_User,fCurrentDir()+"\Config.ini")
INIWrite("Config","PASS",EDT_Pass,fCurrentDir()+"\Config.ini")

//MyConnect is connection --- GLOBAL
MyConnect..Provider = hNativeAccessPostgreSQL
MyConnect..Server = EDT_Host
MyConnect..Source = EDT_Host
MyConnect..Database = EDT_DB
MyConnect..User = EDT_User
MyConnect..Password = EDT_Pass
MyConnect..ExtendedInfo = "WD Cache Size = 10000; Server Port="+Val(EDT_Porta)+";"

//Conexão no PostgreSQl usando porta diferente (15432) em vez da porta padrão (5432)

IF HOpenConnection(MyConnect) = True THEN
ok1 = True
END
IF HChangeConnection("*",MyConnect) = True THEN
ok2 = True
END

IF ok1 = True AND ok2 = True THEN
ToastDisplay("Conectou com Sucesso no PostgreSQL!",toastLong,vaMiddle,haCenter,RGB(0,0,255))
ELSE
Error(ErrorInfo())
END






--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/