Ais-je fait une erreur ou est-ce effectivement comme je le pense un bug ?
---------------
Hello, when I launch the program directly in Purebasic, no worries, the message Connection successful appears, if I compile it and launch the program, I have the error message?
Did I make a mistake or is it actually a bug as I think?
---------------
Code: Select all
;test opendatabase compliler
host.s="XXX.XXX.XXX.XXX"; IP or HostName
port.s="3306"; port
debname.s="test"
username.s="user"
password.s="password"
UseMySQLDatabase()
tentative_co_sql:
db_connect.i=OpenDatabase(#PB_Any, "host="+host.s+" port="+port.s+" dbname='"+debname.s+"'", username.s, password.s,#PB_Database_MySQL)
If IsDatabase(db_connect.i)
MessageRequester(title.s,"Connexion réussi à la base de données.",#PB_MessageRequester_Info|#PB_MessageRequester_Ok)
Delay(30)
CloseDatabase(db_connect.i)
Else;erreur de connexion
dberreur.s=DatabaseError()
If tentative_sql.i=3;il y a eu trois essais, on arrête la
MessageRequester(title.s,"Echec de connexion à la base de données après 3 essais."+#CRLF$+dberreur.s,#PB_MessageRequester_Error|#PB_MessageRequester_Ok)
Else;on a pas atteint trois essais, on retente
tentative_sql.i+1
Delay(300)
Goto tentative_co_sql
EndIf
EndIf
End 0
// Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)


