Database.UserName

From Xojo Documentation

Revision as of 18:45, 12 November 2019 by PLefebvre (talk | contribs) (Sample Code)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Property (As String )
aDatabase.UserName = newStringValue
or
StringValue = aDatabase.UserName

Supported for all project types and targets.

The username that is required for access to the database.

Sample Code

This code connects to a PostgreSQL database called "BaseballLeague":

Var db As New PostgreSQLDatabase
db.Host = "192.168.1.172"
db.Port = 5432
db.DatabaseName = "BaseballLeague"
db.UserName = "broberts"
db.Password = "streborb"
Try
db.Connect
// Use the database
Catch error As DatabaseException
// DB Connection error
MessageBox(error.Message)
End Try