473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DO i need to close this as well ?

Fary4u
273 100+
Hi
Do i need to close the Connection as well?

<%
Connection = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="a.mdb"
sSQL = "SELECT * FROM Products"
set rsProdInfo = Server.CreateObject("ADODB.RecordSet")
rsProdInfo.open sSQL, Connection,adOpenKeyset,adLockReadOnly

Program Running . . .

rsProdInfo.Close
set rsProdInfo = Nothing

' DO I NEED TO CLOSE THE CONNECTION ?
Connection.Cose
set Connection = Nothing
%>

Regards
Fary4u
Jul 27 '07 #1
4 1106
ilearneditonline
130 Expert 100+
<%
' DO I NEED TO CLOSE THE CONNECTION ?
Connection.Cose
set Connection = Nothing
%>
I always do, but then again everyone tells me I am anal about things like that. I like to be on the safe side, besides what can it hurt to ensure that you have cleaned up after yourself.
Jul 28 '07 #2
jhardman
3,406 Expert 2GB
I always do, but then again everyone tells me I am anal about things like that. I like to be on the safe side, besides what can it hurt to ensure that you have cleaned up after yourself.
ilearnedit is right, it is a good idea to do it, but asp scripts close all connections automatically at the end of the script, so it is not necessary.

Jared
Jul 30 '07 #3
Fary4u
273 100+
That's why when i do this it's give me error

<%
Connection.Cose
set Connection = Nothing
%>

or without this program continue working . . .

?????
Aug 1 '07 #4
ilearneditonline
130 Expert 100+
That's why when i do this it's give me error

<%
Connection.Cose
set Connection = Nothing
%>

or without this program continue working . . .

?????
It is Connection.Close not Connection.Cose.

Sorry, I read your initial code sample incorrectly. You are not using connection as ADODB.Connection so there is not any need to do a Connection.Close. You could still do set Connection = nothing just to clean up the string.
Aug 1 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Steve | last post by:
Hi, I have a nice little script that works well displaying images on my website. It's a script where if you clik a thumbnail image a pop up window opens that contains a larger version of the same...
2
by: kevin dalby | last post by:
I use the script below to open a side panel on my desktop without all the buttons and menu items. IE 6 It works well. What I'd like to add is add a line of code that will close the calling...
6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
2
by: Lin Ma | last post by:
Hello, I have a general question. In my asp page, I have DB connection, Recordset, and some variables like dim name, conn, rs set conn = Server.CreateObject("ADODB.Connection") .... set rs=...
11
by: Karl Irvin | last post by:
My program looks like this: Dim db As DAO.Database, rst As DAO.Recordset Set db = CurrentDb Set rst = db.OpenRecordset("SELECT * FROM tUnpaidInvoiceIDs WHERE TxnType = 'Invoice'") Do some...
4
by: Dan | last post by:
In the following example, is it necessary to close the FileStream object as well as the StreamWriter object? FileStream fs = new FileStream(fileName, FileMode.CreateNew, FileAccess.Write,...
4
by: Paul H | last post by:
A typical chunk of code...... Set db = CurrentDb Set rs = db.OpenRecordset("tblFoo") <Do some stuff here> 'How much of the stuff below do I need? 'Do I need to close the recordset?...
5
by: Eric Layman | last post by:
Hi, Many years ago when I first learnt abt web dev in school, I was taught this methodology: <html> blah blabh
6
by: zaina | last post by:
hi everybody i am nwebie in this forum but i think it is useful for me and the member are helpful my project is about connecting client with the server to start exchanging messages between...
3
by: Eric_Dexter | last post by:
I am trying to take some data in file that looks like this command colnum_1 columnum_2 and look for the command and then cange the value in the collum(word) number indicated. I am under...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.