Closing connection in ASP

Magno
Member Posts: 168
Hi,
i have to write a connection in ASP to Navision DB Server 3.6
it works, but when i close the connection in the code, and i look to the connection in the database, the connection is still shown.
So i conclude the connection in navision is still pending. in ASP however i am sure the object and the connection are closed.(checked with conn.state) and the i set conn=nothing. but still showing in navision itself...
Does anyone know how i can solve this?
i have to write a connection in ASP to Navision DB Server 3.6
it works, but when i close the connection in the code, and i look to the connection in the database, the connection is still shown.
So i conclude the connection in navision is still pending. in ASP however i am sure the object and the connection are closed.(checked with conn.state) and the i set conn=nothing. but still showing in navision itself...
Does anyone know how i can solve this?
0
Comments
-
Hi
I am doing the same thing as trying to connect navision native db with ASP let me show u the code but im not able to connect it as it gives the error
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft Business Solutions ApS][Microsoft Business Solutions-Navision ODBC Driver]ISAM error
/asp/aa.asp, line 7
code is
Dim strSQL, strDSN
Dim i
strSQL="Select * from Customer"
strDSN="DSN=Navision"
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open strSQL,strDSN
Can u tell me pls what is the problem or source code for asp to connect navision table
Thanks in advance
Vishal0 -
visgold wrote:
Dim strSQL, strDSN
Dim i
strSQL="Select * from Customer"
strDSN="DSN=Navision"
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open strSQL,strDSN
this won't work, try instead of rs.open strsql,strdsn
make a connection first, this one must be given as 2nd parameter like:Dim strSQL, strDSN Dim i strSQL="Select * from Customer" strDSN="DSN=Navision" Set rs=Server.CreateObject("ADODB.Recordset") set conn=server.createobject("ADODB.CONNECTION") conn.open strDSN rs.Open strSQL,conn ... ... rs.close set rs=nothing conn.close set conn = nothing
don't forget to close connection and recordset and clear them, otherwise your webservers memory will be full quickly.0 -
Hi
Thanks For ur reply
Now i am using this code as per some more reviews and ur suugestion
Code is
<%
Set conn=server.CreateObject("ADODB.Connection")
Set RS = server.CreateObject("ADODB.RecordSet")
dsn = "DSN=Navision"
dsn = "DRIVER={C/ODBC 32 bit};"
dsn = dsn & "UID=super;"
dsn = dsn & "PWD=super;"
dsn = dsn & "sName=local;"
dsn = dsn & "NType=tcp;"
dsn = dsn & "CN=CRONUS Dutch Ltd.;"
dsn = dsn & "CSF=Yes;"
dsn = dsn & "SERVER=N;"
dsn = dsn & "RD=No;"
dsn = dsn & "ML=2048;"
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"
conn.Open dsn
SQL="Select * from Customer"
RS.Open SQL, conn
%>
Even with this code i am not able to connect with Navision Native DB and still i am getting ISAM Error
](*,)
Please suggest me the solution
Vishal0 -
make sure the hosts file is filled in(%windir%\system32\drivers\etc\hosts)
with a line like (127.0.0.1 local)
or instead of sName=local put sName=IPADDRESS
If you run more than 1 server => the services file(same dir) must be filled in to.
if it is not a database server the dsn must be something like
(otherwise don't use the sName=local!!)
DRIVER=C/ODBC 32 bit;
SERVER=N;
CN=CRONUS BELGIUM NV;
RD=No;
ML=2048;
CD=No;
BE=Yes;
CC=Yes;
RO=No;
QTYesNo=Yes;
IT=a-z,A-Z,0-9,_;
OPT=Text;
PPath=C:\Navision Clients\Navision Attain 3.6\Client;
Database=c:\Navision Clients\Database.fdb;
CSF=No
I had a isam error to,
the reason was the hosts file the first time and my server wasn't running the second time.0 -
Hi
I have checked that hosts file and it is ok with that line u had suggested
But still i am getting the same ISAM error
ok can u tell me that should i write the whole code which i have shown to u in ASP file or just after assigning these vaues in DSN i have to write few lines like
Set conn=server.CreateObject("ADODB.Connection")
Set RS = server.CreateObject("ADODB.RecordSet")
dsn = "DSN=Navision;"
conn.Open dsn
oh scahde
that even works
Please tell me where is the problem as i think u have did this task with the same profile and error.
Thanks0 -
can u tell me the right solution for this error
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft Business Solutions ApS][Microsoft Business Solutions-Navision ODBC Driver]ISAM error
I tried both with dsn and dsn less but the error is same even one thing want to share if i make dsn less connection i am using provider msjetoledb 4.0 but the error comes that the provider is not properly installed.
as i am getting again and again
pls
Vishal0 -
visgold wrote:Now i am using this code as per some more reviews and ur suugestion
Code is
<%
Set conn=server.CreateObject("ADODB.Connection")
Set RS = server.CreateObject("ADODB.RecordSet")
dsn = "DSN=Navision"
dsn = "DRIVER={C/ODBC 32 bit};"
dsn = dsn & "UID=super;"
dsn = dsn & "PWD=super;"
dsn = dsn & "sName=local;"
dsn = dsn & "NType=tcp;"
dsn = dsn & "CN=CRONUS Dutch Ltd.;"
dsn = dsn & "CSF=Yes;"
dsn = dsn & "SERVER=N;"
dsn = dsn & "RD=No;"
dsn = dsn & "ML=2048;"
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"
conn.Open dsn
SQL="Select * from Customer"
RS.Open SQL, conn
%>
Vishal
You got a missing "dsn & ", is that suppose to be missing?
And, because of that, your code will end up having missing "dsn = "DSN=Navision;"" in your connection string.Regards,
Peter Ng0 -
thats not important, its just a name you give your dsn. the DSN=XXXXX tag isn't needed to work correct0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions