ASP With Native Navision DB

visgoldvisgold Member Posts: 21
Hi

I am trying to access data from a navision Table using DSN named "Navision" but i am getting this error again and again

let me show u the code and dsn setting i am using

Code is
<%
Set conn=server.CreateObject("ADODB.Connection")
Set RS = server.CreateObject("ADODB.RecordSet")
dsn = "DSN=Navision;"
conn.Open dsn (Error lies here)
%>
DSN Setting
dsn = "DRIVER={C/ODBC 32 bit};"
dsn = dsn & "UID= super;"
dsn = dsn & "PWD= super;"
dsn = dsn & "sName=IP Address;"
dsn = dsn & "NType=tcp;"
dsn = dsn & "CN=CRONUS India Ltd.;"
dsn = dsn & "CSF=Yes;"
dsn = dsn & "SERVER=N;"
dsn = dsn & "RD=No;"
dsn = dsn & "ML=1033;"
'dsn = dsn & "CD=No;"
'dsn = dsn & "BE=Yes;"
'dsn = dsn & "CC=Yes;"
'dsn = dsn & "RO=No;"
'dsn = dsn & "QTYesNo=Yes;"
'dsn = dsn & "IT=a-z,A-Z,0-9,_;"
'dsn = dsn & "OPT=Text"
'PPath=C:\Navision Clients\Navision Attain 3.7\Client;
'Database=c:\Navision Clients\Database.fdb;
'CSF=No;
](*,)
Please anybody tell me the soulution or where is the problem in this source code. or may be another alternative solution.As i tried alot but getting ISAM Error again and again

Error is
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft Business Solutions ApS][Microsoft Business Solutions-Navision ODBC Driver]ISAM error
/asp/bb.asp, line 5

Thanks in advance

Comments

  • FabermanFaberman Member Posts: 24
    Hello.

    Unfortunately, I cannot give an answer to your problem, however, I am trying to do the same thing and getting nowhere.

    Did you ever get any response, or did you resolve this issue yourself.
    If you have a resolution, is it possible you can pass it on to me?

    Thanks.
  • GoMaDGoMaD Member Posts: 313
    Hi,

    this topic has already been discussed.

    follow this link
    http://www.mibuso.com/forum/viewtopic.php?t=800&highlight=isam

    or

    search the mibuso forum for ISAM and follow the link to the following topic: 'CODBC/ADO/ISAM Errors: What I have learned so far...'

    Read the reply from bfernandes carefully. This one helped me alot with these kind of errors.

    Greetings,
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
  • FabermanFaberman Member Posts: 24
    Visgold,

    We run Navision 2.60G db with 3.70 executables.

    I setup the system DSN "Navision" on the server from which the system will run. I configured it as necessary i.e.

    we run client/server, so I

    chose connection - server
    entered the path to the server program (it can be a mapped drive)
    specified the server name
    net type (tcp)
    company name
    username
    password

    I did go into "options" and change "identifiers" to "all characters" with the intention of using the field names etc. straight out of Navision in queries etc.

    Then an asp page to access Navision :

    <%@ LANGUAGE="VBScript" %>
    <%

    Dim strSQL, strDSN
    Dim ocon, rs

    strSQL="Select * from Customer"
    strDSN="DSN=Navision"

    set ocon=Server.CreateObject("ADODB.Connection")
    ocon.open strDSN

    Set rs=Server.CreateObject("ADODB.Recordset")
    rs.Open strSQL, ocon

    Response.Write "<TABLE BORDER=1>"

    Response.Write "<TR>"

    Response.Write "<TH>" & "Account No." & "</TH>"
    Response.Write "<TH>" & "Customer Name" & "</TH>"
    Response.Write "<TH>" & "Address" & "</TH>"
    Response.Write "<TH>" & "Area" & "</TH>"
    Response.Write "<TH>" & "Town / City" & "</TH>"

    Response.Write "</TR><BR>"

    Do while not rs.eof
    Response.Write "<TR>"

    Response.Write "<TD>"
    Response.Write rs("No.")
    Response.Write "</TD>"
    Response.Write "<TD>"
    Response.Write rs("Name")
    Response.Write "</TD>"
    Response.Write "<TD>"
    Response.Write rs("Address")
    Response.Write "</TD>"
    Response.Write "<TD>"
    Response.Write rs("Address 2")
    Response.Write "</TD>"
    Response.Write "<TD>"
    Response.Write rs("City")
    Response.Write "</TD>"

    Response.Write "</TR>"
    rs.movenext
    Loop

    Response.Write "</TABLE>"

    rs.close
    set rs=nothing
    set ocon=nothing
    %>

    There are much sweeter ways of getting your headings and specific datafields, but this is simple and a place to start.

    I have tried more specific queries i.e.

    strSQL="SELECT No.,Name,Address,Address 2,City FROM Customer WHERE Department Code='Retail'"

    to which I get the following error message :

    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft Business Solutions ApS][Microsoft Business Solutions-Navision ODBC Driver]Expected lexical element not found: FROM

    So if you get this working, perhaps you can tell me what the error is.

    I hope this helps you.
  • GoMaDGoMaD Member Posts: 313
    strSQL="SELECT No.,Name,Address,Address 2,City FROM Customer WHERE Department Code='Retail'"

    Have you tried to put " " or [ ] around the Address 2 field?
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
  • FabermanFaberman Member Posts: 24
    Hi.

    Yes. I've tried putting [ ] around all non-keywords too (except) the crtieria) i.e.

    strSQL="SELECT [No.],[Name],[Address],[Address 2],[City] FROM [Customer] WHERE [Department Code]='Retail'"

    in the hope that keywords would be distinguished from fieldnames etc.

    This version :

    strSQL="SELECT [No.],[Name],[Address],[Address 2],[City] FROM [Customer] WHERE [Department Code]="Retail""

    gave me an "expected end of statement" error, which made a change.

    Otherwise, I am pretty stuck. ](*,)
  • GoMaDGoMaD Member Posts: 313
    strSQL="SELECT [No.],[Name],[Address],[Address 2],[City] FROM [Customer] WHERE [Department Code]="Retail""

    The "" around Retail, shouldn't it be ' ' instead of " "?

    So becoming:
    strSQL="SELECT [No.],[Name],[Address],[Address 2],[City] FROM [Customer] WHERE [Department Code]='Retail'"
    

    Have you tried to use MS Query to build the SQL Statement?
    Try to get the required data in an Excel sheet using MS Query.
    Always a good way of checking for syntax error's.
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
Sign In or Register to comment.