473,395 Members | 2,443 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,395 software developers and data experts.

ADODB.Connection closing issues

I have some code that hits a DB2 database from my ASP.NET application. I
haven't been able to exactly nail it down but my connections are not getting
closed for some reason. I look at the database and it's like everytime I
click a button in the ASP.NET applicaiton and it runs a database command it
leaves the connection open. The DBA's are not happy with me right now.
Luckily I'm still in test. Does anyone have any idea why the below code is
not closing the connection to the database correctly. Or maybe it has
something to do with the version of DB2, CAE, or I need to add a IMB DB2
reference to my project. Any help will be help.

Thanks.
Andy
Dim DataConn As ADODB.Connection
DataConn = New ADODB.Connection DataConn.ConnectionTimeout =
Session("DataConn_ConnectionTimeout") DataConn.CommandTimeout =
Session("DataConn_CommandTimeout")
DataConn.Open(Session("DataConn_ConnectionString") ,
Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword"))

rs = New ADODB.Recordset
rs.Open("Select distinct(camp_id)" & " from atlt.camps_web_camp where
camp_id >=' '" & " Order by camp_id asc", DataConn, 1, 3)

DataConn.close( )

Nov 19 '05 #1
3 2640
Andy,

Is this ASP.NET or possible Classic ASP?

If it is ASP.NET, you might look at using the native iSeries connector
provided by IBM. There are some issues with it under ASP.NET 2.0 but it
works well with v1.x. Otherwise, you might look at using the navtive OLEDB
provider. Not sure if "native" is the correct term here, but it works well.

If you are using Classic ASP with Classic ADO, you might try posting this to
the microsoft.public.data.ado group.

-Andrew

"Andy G" <aj*****@iastate.edu> wrote in message
news:Ov**************@TK2MSFTNGP14.phx.gbl...
I have some code that hits a DB2 database from my ASP.NET application. I
haven't been able to exactly nail it down but my connections are not
getting closed for some reason. I look at the database and it's like
everytime I click a button in the ASP.NET applicaiton and it runs a
database command it leaves the connection open. The DBA's are not happy
with me right now. Luckily I'm still in test. Does anyone have any idea
why the below code is not closing the connection to the database correctly.
Or maybe it has something to do with the version of DB2, CAE, or I need to
add a IMB DB2 reference to my project. Any help will be help.

Thanks.
Andy
Dim DataConn As ADODB.Connection
DataConn = New ADODB.Connection DataConn.ConnectionTimeout =
Session("DataConn_ConnectionTimeout") DataConn.CommandTimeout =
Session("DataConn_CommandTimeout")
DataConn.Open(Session("DataConn_ConnectionString") ,
Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword"))

rs = New ADODB.Recordset
rs.Open("Select distinct(camp_id)" & " from atlt.camps_web_camp where
camp_id >=' '" & " Order by camp_id asc", DataConn, 1, 3)

DataConn.close( )

Nov 19 '05 #2
PL

Looks a lot like classic ASP code, not ASP.NET

The only thing I can suggest is that the open connections was left open
after an error occurred while testing, if you get an error in your query it would
not continue down and close the connection.

Error handling was a real pain in classic ASP, if at all possible you should
consider moving to ASP.NET.

PL.
"Andy G" <aj*****@iastate.edu> skrev i meddelandet news:Ov**************@TK2MSFTNGP14.phx.gbl...
I have some code that hits a DB2 database from my ASP.NET application. I haven't been able to exactly nail it down but my
connections are not getting closed for some reason. I look at the database and it's like everytime I click a button in the ASP.NET
applicaiton and it runs a database command it leaves the connection open. The DBA's are not happy with me right now. Luckily I'm
still in test. Does anyone have any idea why the below code is not closing the connection to the database correctly. Or maybe it
has something to do with the version of DB2, CAE, or I need to add a IMB DB2 reference to my project. Any help will be help.

Thanks.
Andy
Dim DataConn As ADODB.Connection
DataConn = New ADODB.Connection DataConn.ConnectionTimeout = Session("DataConn_ConnectionTimeout") DataConn.CommandTimeout =
Session("DataConn_CommandTimeout")
DataConn.Open(Session("DataConn_ConnectionString") , Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword"))

rs = New ADODB.Recordset
rs.Open("Select distinct(camp_id)" & " from atlt.camps_web_camp where camp_id >=' '" & " Order by camp_id asc", DataConn, 1, 3)

DataConn.close( )

Nov 19 '05 #3
Good ideas Andrew. This was a ASP app that I just converted to ASP.NET.
The code still resides in the HTML of the page <% %>. I think it might come
down to this line: DataConn.close( ). It should be DataConn.Close

It looks like the connections are being closed now. You would think I'd get
an error doing it using .Close( ), huh, anyways.

Thanks
Andy
"Andrew Robinson" <ne****@nospam.nospam> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
Andy,

Is this ASP.NET or possible Classic ASP?

If it is ASP.NET, you might look at using the native iSeries connector
provided by IBM. There are some issues with it under ASP.NET 2.0 but it
works well with v1.x. Otherwise, you might look at using the navtive OLEDB
provider. Not sure if "native" is the correct term here, but it works
well.

If you are using Classic ASP with Classic ADO, you might try posting this
to the microsoft.public.data.ado group.

-Andrew

"Andy G" <aj*****@iastate.edu> wrote in message
news:Ov**************@TK2MSFTNGP14.phx.gbl...
I have some code that hits a DB2 database from my ASP.NET application. I
haven't been able to exactly nail it down but my connections are not
getting closed for some reason. I look at the database and it's like
everytime I click a button in the ASP.NET applicaiton and it runs a
database command it leaves the connection open. The DBA's are not happy
with me right now. Luckily I'm still in test. Does anyone have any idea
why the below code is not closing the connection to the database
correctly. Or maybe it has something to do with the version of DB2, CAE,
or I need to add a IMB DB2 reference to my project. Any help will be
help.

Thanks.
Andy
Dim DataConn As ADODB.Connection
DataConn = New ADODB.Connection DataConn.ConnectionTimeout =
Session("DataConn_ConnectionTimeout") DataConn.CommandTimeout =
Session("DataConn_CommandTimeout")
DataConn.Open(Session("DataConn_ConnectionString") ,
Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword"))

rs = New ADODB.Recordset
rs.Open("Select distinct(camp_id)" & " from atlt.camps_web_camp where
camp_id >=' '" & " Order by camp_id asc", DataConn, 1, 3)

DataConn.close( )


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Simone | last post by:
Hello I hope you guys can help me. I am very new to ADO... I am creating a ADODB connection in a module and trying to access it from a command button in a form. Function fxEIDAssgn(plngEID As...
2
by: Jim Lacenski | last post by:
I have a VB class that uses .NET and ADODB to write into an Excel spreadsheet (via Jet) on a server as part of a web application. ADODB is used instead of ADO.NET because it greatly simplifies the...
6
by: ASP.Confused | last post by:
I have an ASP.NET page writtein in VB that uses ADODB. I just had to force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses this, and I wanted to be compatible with them.) I...
0
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
0
by: Daniel Crespo | last post by:
Hi to all, I'm using adodb for accessing mysql and postgres. My problem relies on the mysql access. Sometimes, when I try to execute a query (using ExecTrans method below), I get this error:...
3
by: Yuk Tang | last post by:
I'm trying to grab the fieldnames and values from a recordset, but I'm getting errors. I have an idea what the error might come from, but I'm not sure how to correct it. I'm connecting to an...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
4
by: Fred Zuckerman | last post by:
I have a A2K database that includes some linked tables (these links are SQL views). Sometimes there are "issues" with the SQL server and the users receive a timeout error whenever they try to...
2
bmallett
by: bmallett | last post by:
I am getting the following error: Error Type: ADODB.Command (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another....
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.