Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2006, 05:28 PM
Authorized User
 
Join Date: Jun 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with ASP page

Hi,

I wrote a basic asp page to do a simple 'select' from an ACCESS database. When I run the page, it just hangs and hangs. What am I doing wrong?

I am using ACCESS 2003 and I don't know what version of ASP I am running but its NOT asp.net. It is whatever is supported with IIS 6.0. below is my code:

thank you:

<%@ LANGUAGE="vbscript" %>


<html>
<head>
<title>Metrics</title>
</head>
<body>
<%

'Create the object
set metricsDB = Server.CreateObject("ADODB.Connection")
strSQL = "SELECT [Issue ID] FROM QPTActions"
'Open the connection
metricsDB.Open "metrics"
set itemSet = Server.CreateObject("ADODB.RecordSet")
itemSet.Open strSQL, metricsDB, adOpenForwardOnly

if Not itemSet.EOF then
%>

<%=itemSet.Fields("").Value%><br>

<%
itemSet.MoveNext
end if
'Close recordset
itemSet.Close
set itemSet = Nothing
'Close the connection
metricsDB.Close
'Destroy the connection
set metricsDB = Nothing
%>

</body>
</html>
 
Old June 12th, 2006, 03:54 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Post this in an ASP forum, this is for ASP.NET

 
Old June 12th, 2006, 03:54 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Try:

Do While Not itemSet.EOF
%>
<%=itemSet.Fields("").Value%><br>
<%
itemSet.MoveNext
Loop

I've never liked getting a recordset like you're doing it. I like to use:

Set itemSet = metricsDB.Execute(strSQL)

I haven't used Access for quite a while but there looks like there could be a problem with your connection string to the .mdb file. There isn't a path either so I don't know how the application could find the file. There's lots of examples of Access connections strings on the net. I just don't have one handy.





 
Old June 12th, 2006, 04:03 PM
Authorized User
 
Join Date: Jun 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you.

Can someone recommend a good ASP forum?
 
Old June 12th, 2006, 07:48 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

http://p2p.wrox.com/forum.asp?FORUM_ID=54






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem accessing a .dll component in asp.net page ng4123 ASP.NET 1.0 and 1.1 Basics 5 May 10th, 2006 07:31 AM
DataList ItemCommand event problem in ASP.NET page naidukap ASP.NET 1.0 and 1.1 Professional 0 December 26th, 2005 03:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.