Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 October 28th, 2003, 10:47 AM
Registered User
 
Join Date: Oct 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default HELP THIS IS MY CODE

WHY ISNT HIS WORKING!?!?!?!?!


<html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Update Version Number</title>
</head>
<body>

<p align="center">Update Version Number</p>
<p align="center">The Filename must be in a standard format eg.
v2.html or v2-1.html</p>
<form "update.asp?action=editsave" method="post">
  <p align="center">ECS
  Version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F ilename</p>
  <p align="center">
  <input type="text" name="ECSVersionB" size="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;
  <input type="text" name="FilenameB" size="20"></p>
  <p align="center">
 </form>
    <input type="submit" value="Add" name="Add" language="JavaScript" onclick="self.location.href = 'update.asp?action=list'">

    <%
Select Case Request.QueryString("action")
Case "editsave"
            SQL = "UPDATE ECS SET ECSVersion = '" & Request.Form("ECSVersionB") & "', " & "Filename = '" & Request.Form("FilenameB")'"
            set conn = server.createobject("ADODB.Connection")
            conn.ConnectionTimeout=5
            conn.CommandTimeout=5
            conn.open "ecs"
            set rs = conn.execute(SQL)
            rs.movefirst

            loop
            rs.close
            set rs = nothing
            conn.close
            set conn = nothing

        %>
</body>

</html>

 
Old October 28th, 2003, 11:04 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It's hard to tell what problem you encounter, since you didn't define "IS NOT WORKING".....

Anyway, an UPDATE statement does not return a recordset, so there is no point in setting the results of Execute to rs.

Also, when the SQL statement was meant to be a SELECT statement, this is another problem:
Code:
set rs = conn.execute(SQL)
rs.movefirst
A recordset created by calling the Execute method of a Connection object is always a read-only, forward-only recordset and therefore does not support MoveFirst.

Finally, Loop doesn't make much sense all by itself. You'll need a While to be able to do a loop.

HtH,

Imar



---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent:hard disk serial code and vb code ivanlaw Pro VB 6 0 July 25th, 2007 04:05 AM
VB: .Exe file, serial code and activation code ivanlaw Pro VB 6 8 July 6th, 2007 05:44 AM
code clinic - Why wont example asp code work? jardbf Classic ASP Basics 3 April 27th, 2006 06:22 PM
Writing Client Side Script from Code-Behind code sajid_pk Classic ASP Databases 1 January 18th, 2005 12:53 AM
disable forum code within [code] blocks? nikolai Forum and Wrox.com Feedback 0 October 23rd, 2003 07:52 PM





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