CODBC connection

i am trying to access navision server database using ASP by making DSN with CODBc but it is showing error.Code is running fine when we are using DSN for Sql server. Here is the code as under. <% Set OBJdbConnection = Server.CreateObject("ADODB.Connection") OBJdbConnection.Open "dsn=Nav_sol;uid=super;pwd=coitsmmt;"//for navision database connection Set SQLStmt = Server.CreateObject("ADODB.Command") Set RS = Server.CreateObject ("ADODB.Recordset") //emp = "[" & "CRONUS" & " " & "International" & " " & "Ltd_" & "$Customer" & "]" test1 = "[" & "CRONUS" & " " & "International" & " " & "Ltd_" & "$Customer" & "]" SQLStmt.CommandText = "select * from " & test1 SQLStmt.CommandType = 1 Set SQLStmt.ActiveConnection = OBJdbConnection RS.Open SQLStmt Do While Not RS.EOF response.write(rs(2)) response.write("<br>") RS.MoveNext Loop %> Thanks in advance

For a C/ODBC data source, the Company name is a property of the connection, and must not be specified as part of the table name. Try changing your select statement to:"select * from Customer"

Hi but how to set Company name in a property of the connection?

From the Product CD, Doc folder, ‘w1w1codbc.pdf’ manual, you can find a complete description of C/ODBC connection string options. Here’s a sample:

quote:


The following lines are an example of a complete connection string. DSN=My Source;PPath=C\FIN:;TP=C:\WINDOWS\TEMP;CSF=No; Database=C:\FIN\DATABASE.FDB;CN=My Company; UID=;PWD=;CS=100;OPT=Text;QTYesNo=Yes;QT=200; IT=AllCharacters;RO=No;CC=Yes;BE=No