Unable to connect to Nav 3.7 native DB using CODBC in ASP

techietechie Member Posts: 2
ASP connect to MBS Navision MY3.70
I am trying to use CODBC to connect to MBS Navision MY3.70 native database using Microsoft Interdev 6.0 (Active Server Pages (ASP). I already created DSN in the ODBC Manager.
The below is the code:

SQL="Select * from Customer"

Set conn=server.CreateObject("ADODB.Connection")

conn.Open "DRIVER={C/ODBC 32 bit};Data source=NavASP;Database=E:\program Files\MBS Navision MY3.70\Client\database.fdb;PPATH=E:\program Files\MBS Navision MY3.70\Client;UID=sisb;PWD=;CN=CRONUS Malaysia Sdn. Bhd.;"

Set RS = server.CreateObject("ADODB.RecordSet")
RS.Open SQL, conn


When I run the program , the following error is return:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft Business Solutions ApS][Microsoft Business Solutions-Navision ODBC Driver]ISAM error


Any solution(s) for the above problem?

Comments

  • Nico_DekkerNico_Dekker Member Posts: 7
    Hi Techie,

    First of all make sure you have defined the DSN correctly on the computer running IIS. It should be an System DSN rather then a User DSN. Write down the name you use for this DSN entry, for example Navision. Also check out the Options settings regarding the conversion of identifiers. I prefer to select the a-z,A-Z,0-9 option where every space or dot is replaced with an underscor in fieldnames.

    Next put the following code in your ASP page

    <%
    myDSN="DSN=Navision"

    set conntemp=server.createobject("adodb.connection")
    conntemp.open myDSN

    mySQL = "SELECT * from item"
    response.write mySQL & "<br><br>"

    set rstemp=conntemp.execute(mySQL)

    If rstemp.eof then
    response.write "No data found!<br>"
    else
    response.write "<table border=""1"" style=""font-family: Verdana; font-size: 10pt"">"
    response.write "<tr><td width=""20%""><p align=""right"">" & "<B>Inventory</B>" & "</td>"
    response.write "<td width=""20%""><p align=""right"">" & "<B>Sales_ (Qty_)</B>" & "</td>"
    response.write "<td width=""20%""><p align=""right"">" & "<B>No_</B>" & "</td>"
    response.write "<td width=""40%"">" & "<B>Description</B>" & "</td></tr>"

    response.write "<font face=""Verdana"" size=""2"">"
    do until rstemp.eof
    response.write "<tr><td width=""20%""><p align=""right"">" & rstemp("Inventory") & "</td>"
    response.write "<td width=""20%""><p align=""right"">" & rstemp("Sales_(Qty_)") & "</td>"
    response.write "<td width=""20%""><p align=""right"">" & rstemp("No_") & "</td>"
    response.write "<td width=""40%"">" & rstemp("Description") & "</td></tr>"
    response.write "</font>"
    rstemp.movenext
    loop
    end if

    rstemp.close
    set rstemp=nothing
    conntemp.close
    set conntemp=nothing
    %>
  • wicwic Member Posts: 96
    My "system DSN" seems to work (I can select a company), when I launch my ASP page, nothing happens during 5 seconds then a nice error message slave.exe ... send error to microsoft appears. ](*,)
    I shrink the code and it's hanging at the "conntemp.open myDSN ".
    What next? other possibilities to connect to navision from ASP?
    #### Only one can survive ######
  • FabermanFaberman Member Posts: 24
    Wic,

    If you're still having problems connecting to Navision, I've just managed to do it.
    Read my last post in the thread "ASP with Native Navision DB" (My reply to Visgold)

    Hope it helps.
Sign In or Register to comment.