avatar image
Former Member

mysql database connection by odbc ( dialog box)

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
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

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

    Try adding this to your sqlca.DBParm:

    ,"ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT'"

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content