473,508 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

connection.open issue??

RP
This code usually works the first time I run it, but if I hit refresh it
fails with: "Unspecified error - /cosmetic/ask_dup.asp, line 12"

which is the connection.open statement.

Makes me think it's an ODBC driver issue since I am closing the recordset
and connection objects. Are there settings I should be checking on the DSN
for my database? I've never messed with the timeouts etc.

Thanks
Rich
<% @LANGUAGE="VBSCRIPT"%>
<HTML>
<HEAD>
</HEAD>
<BODY >

<SELECT NAME="category">
<OPTION>Select a category... </OPTION>
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "cosmetic"
sql = "SELECT * FROM tblCategory"
Set rs = conn.execute(sql,inNumRecs, 1)

If (rs.EOF and rs.BOF) then
Response.End
else
rs.MoveFirst
do while not rs.EOF
%>
<OPTION VALUE="<%=rs("id")%>"> <%=rs("category")%> </OPTION>
<%
rs.MoveNext
Loop
end if
rs.close
conn.close
Set RS = nothing
Set conn = nothing
%>
</SELECT>

</BODY>
</HTML>



Jul 19 '05 #1
3 5608
What kind of database? Try using a dns-less connection string.

Ray at work

"RP" <ex*******@yahoo.com> wrote in message
news:v4********************@newsread2.prod.itd.ear thlink.net...
This code usually works the first time I run it, but if I hit refresh it
fails with: "Unspecified error - /cosmetic/ask_dup.asp, line 12"

which is the connection.open statement.

Makes me think it's an ODBC driver issue since I am closing the recordset
and connection objects. Are there settings I should be checking on the DSN for my database? I've never messed with the timeouts etc.

Thanks
Rich
<% @LANGUAGE="VBSCRIPT"%>
<HTML>
<HEAD>
</HEAD>
<BODY >

<SELECT NAME="category">
<OPTION>Select a category... </OPTION>
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "cosmetic"
sql = "SELECT * FROM tblCategory"
Set rs = conn.execute(sql,inNumRecs, 1)

If (rs.EOF and rs.BOF) then
Response.End
else
rs.MoveFirst
do while not rs.EOF
%>
<OPTION VALUE="<%=rs("id")%>"> <%=rs("category")%> </OPTION>
<%
rs.MoveNext
Loop
end if
rs.close
conn.close
Set RS = nothing
Set conn = nothing
%>
</SELECT>

</BODY>
</HTML>


Jul 19 '05 #2
RP
You know I would, but I am using Dreamweaver as an IDE and the helps system
is iffy. I can't get up the help reference for the Open statement to be able
to look up the syntax for the DNS less connection. Got any MS Access
examples?

Thanks!

Rich
Jul 19 '05 #3
RP
worked like a charm. Now I hope the client's hosting company will provide
me with the path to the database when I deploy. :)
Thanks to both of you.

Rich
Jul 19 '05 #4

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

Similar topics

3
14494
by: Harry | last post by:
Using Oracle 8i enterprise on win 2000 (sp3) Installed the standard configuration & whenever I make a connection it takes about 10 secs. It's running on a P1900 with 1gb Ram so no reason there...
1
7366
by: David Gamble | last post by:
I am having problems with long timeouts when connecting to or executing commands in SQL Server 2000 SP3. I am writing an application that will be used on laptops within an environment that is...
8
2045
by: DP | last post by:
I read some articles and post how to optimize te speed of asp pages regarding opening and closing DB connections but I am still not sure about this. Is it true that it doesn't matter how many...
10
2489
by: Daniel Fernandes | last post by:
Hi there Let's say due to several reasons I have an ASP.Net application that has a database access class that stores a database connection in a shared member : public class dataaccess ...
4
3628
by: Saverio Tedeschi | last post by:
Hi all gurus, I'm getting a strange behaviour in Web services design: when I try to open a connection, or to fill a DataSet, I get the error in subj (totally unrelated to the actual error). I've...
16
2843
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
6365
by: =?Utf-8?B?RFNJU3VwcG9ydA==?= | last post by:
Hi, I have this ASP.NET application developed with VS.NET 2003 VB.NET and deplyed on Windows 2K server IIS 5. This application uses the following: - Oracle 10G databse - MS Data Access Block...
20
3243
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
9
4749
by: fniles | last post by:
I am using VB.NET 2003 and SQL 2005. To use connection pooling and avoid the error "There is already an open DataReader associated with this Connection which must be closed first." , I understand...
6
8139
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
0
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7054
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
7501
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5633
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,...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.