Options

ODBC Driver generating errors

threefromzerothreefromzero Member Posts: 5
I'm connecting to our Navision db through ASP to create a web portal for our warehouse. My code worked perfectly on our navision test server but when trying to interact with the live server I'm hitting some issues.
strUpdate = "UPDATE " & chr(34) & "Sales Header" & chr(34) & " SET stagedstatus='STAGED " & month(now) & "/" & day(now) & "/" & right((year(now)), 2) & "' WHERE " & chr(34) & "No." & chr(34) & "='SO11915'"

Trying to execute this sql statement gives a "Microsoft Business Solutions-Navision ODBC Driver]Column not found: No." error. However, the field "No." is very definitely in the sales header table. Any ideas? Again, this code worked perfectly when run with the test server but as soon as I switched the DSN to point to the live server I started getting this error.

Comments

  • Options
    SavatageSavatage Member Posts: 7,142
    "' WHERE "

    not that this is my specialty but is the extra quote mark just a typing error on this site or did you copy & paste?
  • Options
    threefromzerothreefromzero Member Posts: 5
    That's actually not an error - it is the closing ' character after the date text. That statement is a little confusing because I'm using chr(34) to generate double quotes around my field names which is being parsed straight into a quote in the code block.

    The fully parsed out statement ends up being:
    UPDATE "Sales Header" SET stagedstatus='STAGED 8/22/05' WHERE "No."='SO11947'
    

    However I have good news which is that I figured out my problem - in creating the DSN it is necessary to go into the advanced options and change "identifiers" to all thanks to Navision's horrible horrible field naming conventions. The reason why the field "No." couldn't be found is due to the period character which was fine after I changed identifiers to all.
  • Options
    SavatageSavatage Member Posts: 7,142
Sign In or Register to comment.