Navigation:  Programming Cookbook > Database Connectivity > Connecting to a Data Source >

Supplying a Username and Password

Previous pageReturn to chapter overviewNext page

Although it is not necessary in this case, some data sources require a username and password to be supplied in order to connect. You can do this using the #uid: and #pwd: methods before making the connection.

c := (DBConnection new)

  dsn: 'NWind';

  uid: 'Tony';

  pwd: 'alpha';