SamcoS
1/12/2018 - 4:47 AM

[Connect to database] #Xojo #PosgreSQL

[Connect to database] #Xojo #PosgreSQL

//Connect to a database
Dim db As New PostgreSQLDatabase
db.Host = "127.0.0.1"
db.Port = 5432
db.DatabaseName = "TestDB"
db.UserName = "XojoUser"
db.Password = "secret"
//Is the database connected?
If db.Connect = True Then
  MsgBox "The database is connected"
Else
  MsgBox "There is an error with the database: " + db.ErrorMessage
End If