PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → 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)
Started by Boller, Jul., 10 2020 7:12 PM - No answer
Registered member
3,159 messages
Popularité : +89 (91 votes)
Posted on July, 10 2020 - 7:12 PM
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/