navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Update statement

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Update statement
Page: [1]
 
Joey

 

Posts: 167
Joined: 5/15/2002
From:
Status: offline

 
Update statement - 4/24/2008 0:01:06   
I'm doing something wrong here:

I want to add the date where the id = the form field id

myDSN ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("../fpdb/test.mdb")

set conntemp=server.createobject("adodb.connection")
conntemp.open myDSN
 
		mySQL = "UPDATE part_tracker SET detail_comp = #" & Date() & "# WHERE ID = ::ID:: "
		conntemp.execute(mySQL)

conntemp.close
set conntemp=nothing


i get this error: Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 'ID = ::ID::'.

if i take away the :: it updates all rows
rdouglass

 

Posts: 9167
From: Biddeford, ME USA
Status: offline

 
RE: Update statement - 4/24/2008 9:10:27   
quote:

mySQL = "UPDATE part_tracker SET detail_comp = #" & Date() & "# WHERE ID = ::ID:: "


Try this:

mySQL = "UPDATE part_tracker SET detail_comp = #" & Date() & "# WHERE ID = " & Request("ID")

The :: stuff only works inside a DRW and that doesn't look like a DRW. :)

That help any?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to Joey)
Joey

 

Posts: 167
Joined: 5/15/2002
From:
Status: offline

 
RE: Update statement - 4/24/2008 9:33:28   
Perfect, thanks Roger.

(in reply to Joey)
Joey

 

Posts: 167
Joined: 5/15/2002
From:
Status: offline

 
RE: Update statement - 4/24/2008 9:55:09   
now i need one more field updated and am getting an error

mySQL = "UPDATE part_tracker SET detail_comp = #" & Date() & "#, detail_by = " & Request("employee") & " WHERE ID = " & Request("ID") conntemp.execute(mySQL)


I tried several variations and get this error: Syntax error (missing operator) in query expression 'employee1'.

(in reply to Joey)
rdouglass

 

Posts: 9167
From: Biddeford, ME USA
Status: offline

 
RE: Update statement - 4/24/2008 10:00:32   
quote:

detail_by = " & Request("employee") & "


Is that a text field? If so, it needs apostrophes like so:

...detail_by = '" & Request("employee") & "' ...

See 'em?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to Joey)
Joey

 

Posts: 167
Joined: 5/15/2002
From:
Status: offline

 
RE: Update statement - 4/24/2008 10:07:16   
Thanks again!

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Update statement
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts