|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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! |
|
#2
|
|||
|
|||
|
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.. ![]() |
|
#3
|
||||
|
||||
|
And Also
update_score("(update_score.Fields.Item("score").Value)") = " & score & "
Double quotes inside Double quotes! try replacing the inner ones with ' (single quote) |
|
#4
|
|||
|
|||
|
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? |
|
#5
|
|||
|
|||
|
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 ![]() |
|
#6
|
|||
|
|||
|
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.. |
|
#7
|
|||
|
|||
|
what object is update_score by the way?
is it a recordset or a connection object? |
|
#8
|
|||
|
|||
|
update_score is a recordset
dreamweaver sets it as a variable |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Update record without a form in Dreamweaver MX |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|