ASP and Navision

i am trying to use ASP with the Navision database. i have used a conenction statement i found in one of the forums. the statement is as follows: 'Getting data from Navision Dim oConn, sConnString, RS Set oConn = CreateObject(“ADODB.Connection”) sConnString = “DSN=Sample C/ODBC 32 bit custom;OPT=Integer;Database=c:\databases\Custom\Database.fdb;” oConn.Open(sConnString) Set RS = oConn.Execute(“Select * from Contact”) msgbox rs(“No_”) 1. in the statement above, can the connection statement be done in a server, instead of going to a database directly? 2. i have managed to perform a select query based on the above statement. but can i do a update statement to a navision database using c/odbc?

Hi. 1. Yes. Open a System DSN that points to the DB you want. First you must setup a system DSN (if you don’t how to do this, reply to this post), then you point to that DSN like this: <% 'on error resume next Set Conn = Server.CreateObject(“ADODB.Connection”) my_DSN = “DSN=Navision;uid=super;pwd=password” conn.open my_DSN … Conn.Close set conn=nothing %> 2. Yes. You can do Selects, Deletes, Updates and Inserts through ODBC. For any kind of statment I used SQL commands like this: conn.execute “UPDATE into …” Regards

the coding that i have written to modify a table is as follows: <% Set Conn = Server.CreateObject(“ADODB.Connection”) my_DSN = “DSN=Navision;uid=;pwd=” conn.open my_DSN set rs = conn.execute(“update into Contact set Name = ‘testing123’”) response.write rs(“Balance`”) Conn.Close set conn=nothing %> upon running it, it gave me some error on expected lexical element not found. i think there is an error on my SQL statement.

Hi.

quote:


…i think there is an error on my SQL statement.


True. The Update statment does not have the word “into” like the insert statment.

quote:


…update into Contact set Name = ‘testing123’")


Regards.

Hi, Could you please specify the parameters for the DSN, like the Driver to use? Thank in advance. Regards

quote:


Originally posted by BFernandes
Hi. 1. Yes. Open a System DSN that points to the DB you want. First you must setup a system DSN (if you don’t how to do this, reply to this post), then you point to that DSN like this: <% 'on error resume next Set Conn = Server.CreateObject(“ADODB.Connection”) my_DSN = “DSN=Navision;uid=super;pwd=password” conn.open my_DSN … Conn.Close set conn=nothing %> 2. Yes. You can do Selects, Deletes, Updates and Inserts through ODBC. For any kind of statment I used SQL commands like this: conn.execute “UPDATE into …” Regards


Hi, My C/ODBC is under “System DSN” and has the following properties: - Data source: the name you will access through the asp connection - Program folder: points to the folder where the client files are. - Connection: server - Server name: the name of the server - Net type: in my case, it’s tcp - Company name: if everything’s OK, you’ll be able to select a company by clicking the “Company” button - User ID and password: the username you entered before in the connection string (must be a user with the rights to do what you want) We’re not over here. Clicking “Options”, leave the standard values of all the fields, except in “Identifiers” which will be “a-z,A-Z,0-9,_” and “option field type” to “integer”. I hope this helps. Regards