SQL errors

Discussion in 'Questions (Windows Mobile)' started by skipper, Dec 17, 2007.

  1. skipper

    skipper Member Licensed User

    Hello all!

    I would like to have a little tip on how to test for "potential" errors running SQL commands.

    eg. How to test if the CONN.OPEN("Data Base = " & AppPath & "\" & myDB) did not generated an error? (HD failure, disk full....)

    Many thanks

    Mimmo
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You should use ErrorLabel to catch errors.
    If the Open method fails then an error will be raised.
    You can then show a message to the user that the sql connection has failed.
     
  3. skipper

    skipper Member Licensed User

    Hello Erel

    many thanks for your quick reply!

    My question was intended to understand when/if the SQL commands/funtions return any value (numerical/boolean or whatever else) to the calling routine as in:

    Do While Reader.ReadNextRow = TRUE
    ...
    Loop

    In this case the ReadNextRow return a bool.

    Thanks
    Mimmo
     
  4. Erel

    Erel Administrator Staff Member Licensed User

Loading...