I am new to PowerBuilder Classic 12.5. I have created ado.net database profile. How can I now connect to it and create a login window to read username and password, validate and let the user access to the program. Please help with a sample code and where do I put the codes? Thanks.
Asked
Active
Viewed 1,036 times
1 Answers
2
Making the database connection was one of the things that took me the longest to learn, not because it's difficult, but because you do it once and don't have to look at it again.
In your code, you'll need to set the properties of the SQLCA global transaction object. If you have the connection defined in your database painter, then you can right-click on it, choose "Properties", and see what the syntax needs to be from the "Preview" tab.
This syntax will (probably) include your security credentials for the connection. You'll need to build your own userid/password prompt and parse the results into the connection string. I don't have ADO.NET installed, but here's a sample of an ODBC connection... straight copy and paste:
// Profile CINEMA3
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = False
SQLCA.DBParm = "ConnectString='DSN=cinema;UID=UserName;PWD=SuperSecurePassword'"

Jason 'Bug' Fenter
- 1,616
- 1
- 16
- 27