//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