/scripts/ahub.form.attachments.js
0

mysql database connection by odbc ( dialog box)

Oct 24, 2016 at 06:06 PM

56

avatar image
Former Member

Hello everyone


I'm trying PowerBuilder 12.6 with MYSQL database, my connection is through ODBC. When the user or password is wrong a dialog box opens, how to avoid the dialog and the error is controlled using "SQLCA.SQLCODE"?

// Profile mysq_nothwin SQLCA.DBMS = "ODBC" SQLCA.AutoCommit = False SQLCA.DBParm = "ConnectString = 'DSN = odbc_mysq; UID =" + ls_usuario + "; PWD =" + ls_contraseña + "'" Connect using sqlca; IF SQLCA.SQLCODE = -1 THEN MessageBox ( "Error!", "No I can connect to the database! ' + SQLCA.SQLErrText) HALT ELSE Close (w_login) open (w_window1) END IF
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Oct 24, 2016 at 07:58 PM
0

Try adding this to your sqlca.DBParm:

,"ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT'"

Share
10 |10000 characters needed characters left characters exceeded
Skip to Content