ODBC connection

WolterNWolterN Member Posts: 3
Hi All,

We manage a connection with a table inside a Navision 4.0 DB. So far so good. Everything works like a charm until Navision, or the connection with it, goes down for whatever reason.
Our program, written insde a Citect Scada application do not recognize, on-time, when this connection is no longer there.

The internal Citect SQL_Connect act upon a returned handle from the Navision ODBC driver. This handle is given as soon as the first attempt is made to create the connection and contains a positive integer if connected and a -1 when it fails. Now our problem.... it is never a -1 because the ODBC driver seems to return always a positive number!

Of course we can act upon a SQL_Exec error but then it is too late to do a few crucial steps inside the proces.

We now loose important production records because they are simply gone!

Does someone can help me out with this or is there someone who has a listing with the ODBC errornumbers and their meening?

Tech info:
- Navision 4.0 SP2
- Microsoft Navision Driver 4.00.02 22100
- Citect v7.0 release 0

Thanks in advance,
best regards,

Wolter

Comments

  • leugimleugim Member Posts: 93
    WolterN wrote:
    (...) Now our problem.... it is never a -1 because the ODBC driver seems to return always a positive number!


    can you test the ODBC connection outside your development? if so, does it work fine?

    and what about create a new table with a few fields, and then use a dataport/xmlport to import/export data to/from Navision?
    in universal text mode of course!! :lol:

    regards
    _______________
    so far, so good
  • WolterNWolterN Member Posts: 3
    Hi Miguel,

    Tnx for your response.

    Unfortunately I can't check outside the environment. Of course I could use Excel for a connection with the DSN, but that's not giving me the return handle I need.

    A new table with fields is not possible for us. We only read a predefined table with approx. 300 on a daily basis with the basic production parameters and from that moment on the production records we gather via SCADA from the production lines are written into Navision real time. Our application connects as a user to Navision via the ODBC DSN. I can't do anything at all in Navision by myself.

    The problem is even worse now because it seems that we must restart our application to be able to SQLConnect again. A SQLDisconnect followed by SQLConnect does not work once we loose the connection.

    What I like to know is what others get as a handle if the connection via the ODBC DSN is not functioning.

    Best regards,

    Wolter
Sign In or Register to comment.