ASP and DAO

Has anyone out there made a successful connection to Navision using DAO in an ASP page? Please help…Thank you…

I have built a basic asp page to allow the employees to enter their time on job on a web page, without having to be a navision user. However, for security reasons, we don’t connect directly to Navision. We chose to use an temporary ACCESS database to keep the data. Then, the Navision system gets the data from the access database. If this can help, I can send you more information…

Hello David, Thanks for your reply. I was kinda giving up hope on anyone replying [:)]. Anyhow, for now we are palnning to do this internally and security would not be an issue. Would you mind giving me the steps from setting up the DSN to actually retrieving Data from Navision and displaying it on a web page. Not only that but I would like to enter employee times on the web page and upload it into Navision also. If you can help me, it would be wonderful. Thanks. Oh another note is that for now I am running this specifically from my PC. I’d like to get it to work on my PC first. I did set my PC up as a local web server.

Also for the sake of knowledge, what type of security issues are you referring to? Wouldn’t security be taken cared of from the Web server if you enable the security? [^]

I agree that the web server is supposed to manage the security and stop the intrusion. However, we prefered to have a solution where all the external exchange with Navision was requested by the Navision system. In this manner, it is impossible to access the Navision database from outside because it is the Navision system who connects and disconnects to ACCESS, using ACCESS as an automation server. In our situation, we use the asp page to allow 400 employees to enter their time in a solution designed for 15 real Navision users. The other reasons for having a dedicated intermediate system where: - PERFORMANCE: To avoid too much traffic that could slow down Navision (100 simultaneous web access would need 100 connections to Navision to get the data). We don’t want the 15 Navision users to have a slower access because of the web time entry, and we could chose to store the data in a temp DB and, for example, set Navision to grab all the data each night at 2 A.M. One connection a day instead of multiple 100’s ! - FLEXIBILITY: We wanted a general solution that we could use with other systems than Navision - LICENSING: What if 100 ADO connections are requested to the Nav server (to get the data) when we have only one CFRONT licence and 15 users? I am not sure for this one.

quote:


Originally posted by Eslee
Also for the sake of knowledge, what type of security issues are you referring to? Wouldn’t security be taken cared of from the Web server if you enable the security? [^]


Ok, I can see why you integrated access into your process. In our instance we might not need to integrate ACCESS but who knows. Maybe in the future we might bring it external but for now, this is internal. Would you mind sending me sample code of your asp and how you connect to Access. Maybe that might help me… Thanks…

I tried to connect directly to Navision from my ASP page, but I always receive an error. The DSN is fully working with Excel or ACCESS, but maybe I made an error… Here is the code I am using: '!!! 'Open a ADO Connection to the database. Set oraCONN = CreateObject(“ADODB.Connection”) oraCONN.Open “ODBC;DATABASE=myDBDatabaseLawFirm;DSN=JOBENTRY;UID=my_id;PWD=my_pw;” ’ ACCESS DSN → Works perfectly 'oraCONN.Open “ODBC;DATABASE=NA360USDevCourse;DSN=NAV360A;UID=my_id;PWD=my_pw;” ’ C/ODBC NAVISION LINK → NOT WORKING Does someone knows what is incorrect? '!!! Here is my complete code: <%@LANGUAGE=VBScript %> <% '<!— ADNM International - Developed by David Godbout : dgodbout@adnm-grp.com —> '<!— Last modification: June 19, 2003 —> '<!— *********************************************************************** —> '<!— ASP Webpage to allow interaction with Navision —> Option Explicit Response.Expires=0 Response.Buffer=True %> <% ’ ************************************************************************************* Sub CreateHTMLObjects() ’ ************************************************************************************* ’ This procedure will: - connect to the database ’ - fill the recordsets ’ - call the procedure to show the items in the form ’ - Close the connection Dim oraCONN ’ ODBC Connection Dim JobRS ’ Recordset Dim JobQrySQL ’ SQL queries to fill the Recordset Dim i '!!! ’ SQL queries JobQrySQL = "SELECT Name, Description " & _ "FROM Job " 'Open a ADO Connection to the database. Set oraCONN = CreateObject(“ADODB.Connection”) 'oraCONN.Open “ODBC;DATABASE=DatabaseLawFirm;DSN=JOBENTRY;UID=my_id;PWD=my_pw;” oraCONN.Open “ODBC;DATABASE=NA360USDevCourse;DSN=NAV360A;UID=my_id;PWD=my_pw;” 'oraCONN.Execute “INSERT INTO Job Values (‘c’, ‘c’, ‘c’, ‘c’, ‘c’);” ’ Init Recordsets Set JobRS = Server.CreateObject(“ADODB.RecordSet”) 'JobRS.Open JobQrySQL, oraCONN JobRS.Open "SELECT * FROM Job ", oraCONN '!!! '*** Write the content of the Job RecordSet If NOT JobRS.BOF Then JobRS.MoveFirst End if While NOT JobRS.EOF For i = 0 To JobRS.Fields.Count -1 Response.write JobRS.Fields(i) & " | " Next Response.write "
" JobRS.MoveNext Wend Response.write " -----------------------------------------------------------------------------------------------------------------------------



" & vbNewLine JobRS.MoveFirst '!!! 'Kill the ADO Connection JobRS.Close oraCONN.Close Set JobRS = Nothing Set oraCONN = Nothing End Sub CreateHTMLObjects %>

Thanks alot David. I will play with it…