Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 4th, 2006, 08:56 AM
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default Wrong Update

Hei igjen!

What is wrong widt my update?


Teknisk informasjon (for kundestøttepersonell)

Feiltype:
Microsoft VBScript-kompileringsfeil (0x800A0401)
Forventet slutt på setning (expected end)

objComm.CommandText = "UPDATE Produkter SET hoyde = 'hoyde', haar = 'haar', oye = 'oye', vekt = 'vekt' " & "WHERE e_post LIKE 'session("epost")'"
---------------------------------------------------------------------------------------------------------------------------------------^

__________________
Internet has become favorable with that tool...thank you Tim Berners-Lee!
Reply With Quote
  #2 (permalink)  
Old March 4th, 2006, 09:39 AM
Wrox Technical Editor
 
Join Date: Dec 2005
Location: , , Canada.
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try these changes...

objComm.CommandText = "UPDATE Produkter SET hoyde = 'hoyde', haar = 'haar', oye = 'oye', vekt = 'vekt' WHERE e_post LIKE '" & session("epost") & "';"

If that doesn't help take a look at this link: http://www.adopenstatic.com/faq/80040e10.asp

- A.Kahtava
Reply With Quote
  #3 (permalink)  
Old March 4th, 2006, 11:13 AM
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hei A. Kahtava

Thank you for answering.

Your suggestion braught me a bit further down the road, but an error msg. says;

Feiltype:
Microsoft VBScript-kjøretidsfeil (0x800A01B6)
Objektet støtter ikke angitt egenskap eller metode: 'CommandText'
(The object do not support the property or method: 'CommandText')

The lines of script (UPDATE) is taken from the book ASP 3.0 (Wrox)
page 580.

Do I have the right ADO-stuff on my disk? Does ADO have anything to do width this. As you understand I have a great deal to learn.

Mvh grstad



Reply With Quote
  #4 (permalink)  
Old March 4th, 2006, 09:09 PM
Wrox Technical Editor
 
Join Date: Dec 2005
Location: , , Canada.
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ADO is associated with this error.
Could you please post the source code that is causing the error, I don't have the ASP 3.0 book on hand.

Here's a previous posting with a similar error: http://p2p.wrox.com/topic.asp?TOPIC_ID=10024

- A.Kahtava
Reply With Quote
  #5 (permalink)  
Old March 7th, 2006, 07:26 AM
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<% option explicit
dim kobling
 %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
    <title>registrering_2_mann_sjekk</title>
</head>

<body>



<%

'Why does this code not update the record in my access db?


If Request.QueryString("snekker") = "on" Then 'checkbox

        dim objComm
        set objComm = server.createobject("ADODB.Command")

    objComm.ActiveConnection = kobling
    objComm.CommandText = "UPDATE Produkt SET ProduktSnekker = 'snekker' WHERE ProduktNavn LIKE '" & session("innsjekknavn") & "';"

    Set objComm = Nothing

    Else

end if

response.redirect "registrering_3_mann.asp"

%>

</body>

</html>


Reply With Quote
  #6 (permalink)  
Old March 10th, 2006, 07:04 AM
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hallo!

I am wondering; is it not possible to update an excisting record
in an Access-db by making use of ASP? Or can it be the OleDB-thing?

I have tryed by the book 3.0, (also the objRs("something").value = "something")

But is INSERT INTO with a WHERE worth trying?

Med vennlig hilsen
grstad

Reply With Quote
  #7 (permalink)  
Old March 10th, 2006, 10:23 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

It is possible to update access dbs from asp.

Can you post your code and any errors you are getting, please?

Cheers,

Chris

Reply With Quote
  #8 (permalink)  
Old March 10th, 2006, 01:55 PM
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hallo Chris!

Thank you for your willingness!

This is the code in question, followed by the error-msg;

<% option explicit
dim kobling
 %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
    <title>registrering_2_mann_sjekk</title>
</head>

<body>

<%

dim objRs

set objrs = server.createobject("ADODB.recordset")

objrs.open "select * from Produkt where ProduktNavn = " & session("ProduktNavn"), kobling, adopenforwardonly, adLockpessimistic, adCmdText

        objrs("ProduktSnekker").value = Request.form ("snekker")
        objrs("ProduktMale").value = Request.form("male")

        objrs.Update

    objrs.close

    set objrs = nothing

    response.redirect "registrering_3_mann.asp"
%>

</body>

</html>




HTTP 500.100 - Intern serverfeil – ASP-feil
Internet Information Services

--------------------------------------------------------------------------------

Teknisk informasjon (for kundestøttepersonell)

Feiltype:
Microsoft JET Database Engine (0x80040E10)
Det er ikke angitt verdi for en eller flere nødvendige parametere.
/innsjekk/registrering_2_mann_sjekk.asp, linje 21


Med vennlig hilsen

grstad

Reply With Quote
  #9 (permalink)  
Old March 10th, 2006, 02:11 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi grstad,

It looks like you have your browser set to return friendly error messages, can you turn this off & then post the error message you get.

In IE this can be found at Tools -> Internet Options -> Advanced -> Browsing -> Show friendly HTTP error messages

Thanks,

Chris

Reply With Quote
  #10 (permalink)  
Old March 10th, 2006, 02:29 PM
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...it seems to be the only error I have. Does the
.value be recognized when there is no method attached to
objRs..?

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
update multiple columns in an update statement debbiecoates SQL Server 2000 1 August 17th, 2008 04:01 AM
Update link doesn't update in FormsView shaly ASP.NET 2.0 Basics 0 December 6th, 2006 04:33 PM
What's wrong with Update grstad Classic ASP Databases 4 March 8th, 2006 04:30 AM
Datagrid.update() and DataAdapter.Update aarunlal ASP.NET 2.0 Professional 2 February 23rd, 2006 11:41 PM
What is wrong with this update statment ? method SQL Server 2000 2 April 23rd, 2005 04:45 AM



All times are GMT -4. The time now is 11:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.