ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 16th, 2000, 03:13 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
ASP / PWS - only works once.. help!

<i><b>Originally posted by : curtis (eludz@hotmail.com)</b></i><br /><br />Can someone tell me why this code only works one time? I'm using a system DSN cause the book I have uses it, and it is just easier this way, once I get ASP all figured, I'll use DSN-less. Until then I want to get this code working EVERY TIME.. not just one database update, then the next time i try it just sits there.. doesn't make sense, because the oRs is being closed! Do I have to close the DSN a different way or does it look like it should be closing? thanks for the time spent.. I appreciate it!<br /><br />--- HTML FILE (smnewprob.html)<br /><html><br /><head><br /><title>Test Form</title><br /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br /></head><br /><br /><body bgcolor="#FFFFFF"><br /><form method="post" action="smupdatenew.asp"><br /><p align="center">Name: <br /><input type="text" name="txtName"><br /> Phone: <br /><input type="text" name="txtPhone"><br /></p><br /><p align="center"> Address: <br /><textarea name="txtAddress" cols="50" rows="2"></textarea><br /></p><br /><div align="center"><br /><input type="submit" value="SUBMIT"><br /></div><br /></form><br /></body><br /></html><br />--- HTML FILE (smnewprob.html)<br /><br /><br />--- ASP FILE (smnewupdate.asp)<br /><%@ LANGUAGE="VBSCRIPT" %><br /><!--#include file="adovbs.inc" --><br /><HTML><br /><HEAD><br /><title>Test UPDATE</title><br /></HEAD><br /><body bgcolor="#FFFFFF" text="#000000" link="#804040" vlink="#008080" alink="#004080"><br /><%<br />strName = cStr(Request.Form("txtName"))<br />strPhone = cStr(Request.Form("txtPhone"))<br />strAddress = cStr(Request.Form("txtAddress"))<br /><br />Set oRs = Server.CreateObject("ADODB.Recordset")<br />oRs.Open "tblMain", "DSN=Small;UID=;Password=;", adOpenKeyset, adLockPessimistic, adCmdTable <br />%><br /><H2 ALIGN=CENTER>Opened Successfully!</H2><br /><%<br />oRs.AddNew<br />oRS.Fields("Name") = strName<br />oRs.Fields("Phone") = strPhone<br />oRs.Fields("Address") = strAddress<br /><br />'save changes to database ("/small/small.mdb")<br />oRS.Update 'save the changes to the records<br />oRS.Close <br />Set oRS = Nothing<br />%><br /><P><br /><H2 ALIGN=CENTER>Thanks for your details!</H2><br />We've received your details and you'll be receiving a copy of our catalogue soon.<br />Once again, thanks for your interest.<br /><P><br /></BODY><br /></HTML><br />--- ASP FILE (smnewupdate.asp)

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > ASP / PWS - only works once.. help!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT