Skip to main content

Hello,

I'm a rookie of this forum.

My name is Giovanni Di Chiara and I write from Italy.

I don't know if my problem has already been detected before.

I'm tried to use the library InstantSQL for connecting to a MS SQL server via ODBC driver. I use RMCobol for Windows.

My Windows is a Windows 10 Pro.

When I connect to databasesource and I pass ID and Password wrong, before of error return code on my program, it is opened in automatic there is a Error Messagebox of SQL server and then it opened  the Connection SQL Server Dialog Box.

It is prossible to disable the "SQL Message Box" and the "Connection SQL Server Dialog".

My program is a service the run on background with no User Interface, the errors I'd like to manage into my program.

My source code:

"


           display "USERDB "     userDB.
           display "PASSWORDDB " passwordDB.
           
           MOVE NOME-DB TO sql-DataSourceName.
           
           IF userDB > SPACE
              SQL CONNECT DATASOURCE
                sql-ConnectionHandle,
                sql-DataSourceName,
                userDB,
                passwordDB,
                TIMEOUT-MAX-DB


              display "con user e password"
              display "loginTimeOut " TIMEOUT-MAX-DB
              
           ELSE
              SQL CONNECT DATASOURCE
                sql-ConnectionHandle,
                sql-DataSourceName
           END-IF.

           IF sql-OK
              MOVE sql-ConnectionHandle TO FRIGO-ConnectionHandle
              MOVE 1 TO CONNESSO-DB
              CALL WOWSETPROP USING WIN-RETURN
                 TX-STATCON
                 "Text"
                 "connessione OK"
           ELSE
              DISPLAY "connessione sql-Return " sql-Return
              
              CALL WOWSETPROP USING WIN-RETURN
                 TX-STATCON
                 "Text"
                 "connessione fallita"
              SQL DESCRIBE ERROR
                 sql-Error-Description
              display "errore " sql-Error-Description

           END-IF.

"

I  attached any pictures.

Thank you for help.

   


#RMCOBOL
#InstantSQL

Hello,

I'm a rookie of this forum.

My name is Giovanni Di Chiara and I write from Italy.

I don't know if my problem has already been detected before.

I'm tried to use the library InstantSQL for connecting to a MS SQL server via ODBC driver. I use RMCobol for Windows.

My Windows is a Windows 10 Pro.

When I connect to databasesource and I pass ID and Password wrong, before of error return code on my program, it is opened in automatic there is a Error Messagebox of SQL server and then it opened  the Connection SQL Server Dialog Box.

It is prossible to disable the "SQL Message Box" and the "Connection SQL Server Dialog".

My program is a service the run on background with no User Interface, the errors I'd like to manage into my program.

My source code:

"


           display "USERDB "     userDB.
           display "PASSWORDDB " passwordDB.
           
           MOVE NOME-DB TO sql-DataSourceName.
           
           IF userDB > SPACE
              SQL CONNECT DATASOURCE
                sql-ConnectionHandle,
                sql-DataSourceName,
                userDB,
                passwordDB,
                TIMEOUT-MAX-DB


              display "con user e password"
              display "loginTimeOut " TIMEOUT-MAX-DB
              
           ELSE
              SQL CONNECT DATASOURCE
                sql-ConnectionHandle,
                sql-DataSourceName
           END-IF.

           IF sql-OK
              MOVE sql-ConnectionHandle TO FRIGO-ConnectionHandle
              MOVE 1 TO CONNESSO-DB
              CALL WOWSETPROP USING WIN-RETURN
                 TX-STATCON
                 "Text"
                 "connessione OK"
           ELSE
              DISPLAY "connessione sql-Return " sql-Return
              
              CALL WOWSETPROP USING WIN-RETURN
                 TX-STATCON
                 "Text"
                 "connessione fallita"
              SQL DESCRIBE ERROR
                 sql-Error-Description
              display "errore " sql-Error-Description

           END-IF.

"

I  attached any pictures.

Thank you for help.

   


#RMCOBOL
#InstantSQL

Hi Giovanni,

The connection error happens before the check for SQL-OK, so the driver message is shown first and then the condition is evaluated.

Maybe you can create an improvement request for that, but I am not sure if it is possible to avoid it.

Regards,


Hi Giovanni,

The connection error happens before the check for SQL-OK, so the driver message is shown first and then the condition is evaluated.

Maybe you can create an improvement request for that, but I am not sure if it is possible to avoid it.

Regards,

I am not an expert on this either, but I am almost certain that this prompt is coming from the ODBC Manager layer, so not available at the application layer.


Hello,

I'm a rookie of this forum.

My name is Giovanni Di Chiara and I write from Italy.

I don't know if my problem has already been detected before.

I'm tried to use the library InstantSQL for connecting to a MS SQL server via ODBC driver. I use RMCobol for Windows.

My Windows is a Windows 10 Pro.

When I connect to databasesource and I pass ID and Password wrong, before of error return code on my program, it is opened in automatic there is a Error Messagebox of SQL server and then it opened  the Connection SQL Server Dialog Box.

It is prossible to disable the "SQL Message Box" and the "Connection SQL Server Dialog".

My program is a service the run on background with no User Interface, the errors I'd like to manage into my program.

My source code:

"


           display "USERDB "     userDB.
           display "PASSWORDDB " passwordDB.
           
           MOVE NOME-DB TO sql-DataSourceName.
           
           IF userDB > SPACE
              SQL CONNECT DATASOURCE
                sql-ConnectionHandle,
                sql-DataSourceName,
                userDB,
                passwordDB,
                TIMEOUT-MAX-DB


              display "con user e password"
              display "loginTimeOut " TIMEOUT-MAX-DB
              
           ELSE
              SQL CONNECT DATASOURCE
                sql-ConnectionHandle,
                sql-DataSourceName
           END-IF.

           IF sql-OK
              MOVE sql-ConnectionHandle TO FRIGO-ConnectionHandle
              MOVE 1 TO CONNESSO-DB
              CALL WOWSETPROP USING WIN-RETURN
                 TX-STATCON
                 "Text"
                 "connessione OK"
           ELSE
              DISPLAY "connessione sql-Return " sql-Return
              
              CALL WOWSETPROP USING WIN-RETURN
                 TX-STATCON
                 "Text"
                 "connessione fallita"
              SQL DESCRIBE ERROR
                 sql-Error-Description
              display "errore " sql-Error-Description

           END-IF.

"

I  attached any pictures.

Thank you for help.

   


#RMCOBOL
#InstantSQL

Not my area of expertise either, but I wonder if there might be a parameter you can add to the connection string to suppress the prompt. That would be driver-specific.

This assumes you have access to the connection string, of course,