ODBC Fatal Error: 182

DroezelDroezel Member Posts: 7
Hello, I've created a simple class library in VB.NET (2.0) to connect to a Native 4.0 database.

A code extract:
Imports system
Imports System.Data
Imports System.Data.Odbc


Public Class NavDb

    Private _cnn As OdbcConnection
    Private _cnStr As String = "Dsn=NavPortal"

    Public Sub New()
        _cnn = New Odbc.OdbcConnection(_cnStr)
    End Sub

    Private Sub OpenConnection()
        Try
            If Not _cnn.State = ConnectionState.Open Then
                _cnn.Open()
            End If
        Catch ex As OdbcException
            Throw New Exception(ex.Message)
        End Try
    End Sub
    ....

End Class

The above code works smoothly (though a little slow) in windows and console applications, but when executed from a web application I get the fillowing error while opening the connection:

http://www.bored.be/stuff/error.jpg
---------------------------
Microsoft Navision Driver - Error
---------------------------
Internal error 182 in module 1.Contact your dealer if you need assistance.
Fatal  Error: 182
---------------------------
OK   
---------------------------

I use Navision Driver v4.00.00.20942, set up as a System DSN.

Any Ideas?
Taking first steps in Navision

Comments

  • kinekine Member Posts: 12,562
    It is interesting... module 1 are errors from OS... the error no is standard Windows error no. But net helpmsg 182 say that it is unknown error no.

    If you use google, you can see the error no in connection to timeouts... it seems like some component is not responding... may be the privileges under which your code run are not allowing to connect to the server...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DroezelDroezel Member Posts: 7
    Found it.

    Visual Studio 2005 has a built in web server for debugging. This does not work with the Navision ODBC. You have to make a virtual folder in Internet Information Services and run the webapplication from there. Works like a charm now.

    Only speed could be better though.

    Ran into another problem. It seems I cannot select date fields. Gets me an 'invalid column name' exception.
    Taking first steps in Navision
Sign In or Register to comment.