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
  #11 (permalink)  
Old March 10th, 2006, 02:39 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Have you tried turning off you browsers "Show friendly HTTP error messages" option - this should give you a more detailed error message with a line number?



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

... no other options regarding HTTP-msg in my menue!

The line, which is uggi-buggi is the SELECT-thig. But
what. Is it missing some & ' ".....

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

...
Feiltype:
Microsoft JET Database Engine (0x80040E14)
Syntaksfeil (operator mangler) i spørreuttrykket ProduktNavn = jmt yym'
/innsjekk/registrering_2_mann_sjekk.asp, linje 21

grstad

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

...can anyone help me with this;

<% option explicit
dim kobling
 %>


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

<html>
<head>
    <title>registrering_1_mann_sjekk</title>
</head>

<body>


<%

dim objCommand,objrs

set objCommand = server.createobject("ADODB.Command")

objCommand.ActiveConnection = kobling
objCommand.CommandText = "SELECT ProduktHoyde, ProduktHaar, ProduktOye, ProduktVekt, ProduktNavn FROM Produkt " & "WHERE ProduktNavn LIKE 'Session("ProduktNavn")'";"

objCommand.CommandType = adCmdText

Set objRs = objCommand.Execute
Set objCommand = Nothing

If objRs.EOF Then

    Response.redirect "start.asp"

    Else

    objrs("ProduktHoyde").value = Request.form("hoyde")
    objrs("ProduktHaar").value = Request.form("haar")
    objrs("ProduktOye").value = Request.form("oye")
    objrs("ProduktVekt").value = Request.form("vekt")

    objrs.update
End if

objrs.Close
Set objrs = nothing

response.redirect "registrering_2_mann.asp"

%>

</body>

</html>




Teknisk informasjon (for kundestøttepersonell)

Feiltype:
(0x80004005)
Uspesifisert feil.
/innsjekk/registrering_1_mann_sjekk.asp, linje 27


Lesertype:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)

Side:
POST 70 bytes til /innsjekk/registrering_1_mann_sjekk.asp

POST-data:
hoyde=150&haar=lys_blond




Med vennlig hilsen

grstad

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

What data type is Session("ProduktNavn")?
Is it an integer or a string?
Does Session("ProduktNavn") have a value assigned to it?
For the rest of my post I will be assuming that Session("ProduktNavn") is a string.

Your SQL statement needs to be fixed, it should read:

objCommand.CommandText = "SELECT ProduktHoyde, ProduktHaar, ProduktOye, ProduktVekt, ProduktNavn FROM Produkt WHERE ProduktNavn LIKE '" & Session("ProduktNavn") & "';"

In the above post are you trying to Add a new record or update an existing record?

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

Hallo!

Thank you for answering, adam kaktava!

Session("ProduktName") does have a value. It is a string and
shall not be updated. Session("ProduktName") is only pointing out
the right record.

The rest of the fields in this record, are still to come (ProduktHaar, ProduktHoyde...).

This fields are TEXT in Access, but have no value assigned.
In this language they are set to 0 or Nothing? Are they not?
Is that a problem; it is realy nothing there to update?
There are actually no fields to assign a new value.
Maybe I could assign them a temporary value in Access?
I do not know if this is the right approach...

Until next time, I will try your code.

Med vennlig hilsen

grstad :)

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

...no, the error says:

Object/Provider is not capable of performing requested operation

I do think that the code itself is ok, but it is not possible
to use that OLEdb Jet 4.0 provider and/or Access in this version.
Access does not totaly supporting he Command-object and all SQL-querys.

Am I right?

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

... I just made the update-thing. If you have truble with updating your Access-db, just ask!

What a deft tool this http is!

Med vennlig hilsen

grstad

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

I'm not sure if you solved your problem or not. If you did congratulations... :)

If not, well... Here are two different ways to update records in ADO.
Example 1:
...
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, objConn, adOpenKeyset, adLockPessimistic, adCmdText

objRS.MoveFirst
objRS("Password") = Request.Form("Password")
objRS("DateLastUpdated") = Date()
objRS.Update
...

Source code taken from: http://www.aspwebpro.com/aspscripts/records/update.asp

Example 2:

...
  sql="UPDATE customers SET "
  sql=sql & "companyname='" & Request.Form("companyname") & "',"
  sql=sql & "contactname='" & Request.Form("contactname") & "',"
  sql=sql & "address='" & Request.Form("address") & "',"
  sql=sql & "city='" & Request.Form("city") & "',"
  sql=sql & "postalcode='" & Request.Form("postalcode") & "',"
  sql=sql & "country='" & Request.Form("country") & "'"
  sql=sql & " WHERE customerID='" & cid & "'"
  on error resume next
  conn.Execute sql
...

Source code taken from: http://www.w3schools.com/ado/ado_update.asp

- A.Kahtava
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 09:15 PM.


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