ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

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 Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old May 26th, 2003, 12:13 PM
Foundation Foundation is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 6 Foundation User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Update record without a form in Dreamweaver MX

I'm new to ASP so I'm using DWMX as a crutch. It created the db connection and recordset code for me and all I want to do is have the page update the db with the result of a variable.

In plain English, I'm trying to update a field called Score in the table quizOne with the results of the variable score where the username field matches the session variable MM_Username. The recordset is called update_score.

Based on other tutorials and forums, I tried this:

Code:
<%
Dim sql_update
	sql_update = "update quizOne set score = ' & score & ' _
		where username = ' & Session("MM_Username") & '"

	update_score.Execute sql_update
%>


and also..

Code:
<%
update_score("(update_score.Fields.Item("score").Value)") = " & score & "
update_score.Filter = "(update_score.Fields.Item("username").Value) = ' & Session("MM_Username") & '"
update_score.Update
update_score.Close
%>


I get either interminated string constant errors, or expected end of statement, or expected ')' regardless of how I try to run this.

Any help would be greatly appreciated!

Reply With Quote
  #2  
Old May 26th, 2003, 07:29 PM
rhamille rhamille is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: pinoy
Posts: 15 rhamille User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try this..

<%
Dim sql_update
sql_update = "update quizOne set score = '" & score & "'" & _
"where username = '" & Session("MM_Username") & "'"

update_score.Execute sql_update
%>

always check your quotes..

Reply With Quote
  #3  
Old May 27th, 2003, 01:03 AM
yassoor's Avatar
yassoor yassoor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Canada - Egypt
Posts: 60 yassoor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
And Also

update_score("(update_score.Fields.Item("score").Value)") = " & score & "

Double quotes inside Double quotes!
try replacing the inner ones with ' (single quote)
__________________
I hope this is of any help to anyone.

Yassoor
http://www.WebsitesCreation.ca

Reply With Quote
  #4  
Old June 2nd, 2003, 03:34 PM
Foundation Foundation is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 6 Foundation User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the tips. I tried the first method and it comes up with:
Object doesn't support this property or method: 'Execute'

I updated the MDAC and it still is coming up with that error. Any ideas?

Reply With Quote
  #5  
Old June 3rd, 2003, 01:04 PM
rhamille rhamille is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: pinoy
Posts: 15 rhamille User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try this..

<%
Dim sql_update
sql_update = "update quizOne set score = '" & score & "' " & _
"where username = '" & Session("MM_Username") & "'"

update_score.Execute sql_update
%>

always check your quotes.. <-- silly me
now i was the one you forgot the space between score & "' " & _ hehehe

Reply With Quote
  #6  
Old June 4th, 2003, 02:51 PM
Foundation Foundation is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 6 Foundation User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Still gives me this..

Object doesn't support this property or method: 'Execute'

I think everything is right but it won't let me use that execute function it seems.

Hmm..

Reply With Quote
  #7  
Old June 5th, 2003, 08:56 AM
rhamille rhamille is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: pinoy
Posts: 15 rhamille User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
what object is update_score by the way?
is it a recordset or a connection object?

Reply With Quote
  #8  
Old June 8th, 2003, 12:28 AM
Foundation Foundation is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 6 Foundation User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
update_score is a recordset

dreamweaver sets it as a variable

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Update record without a form in Dreamweaver MX


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!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway