SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

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 ASP Free Forums Sponsor:
  #1  
Old April 13th, 2004, 10:38 PM
mag mag is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 6 mag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sql Update not working-HELP!!

Can anyone tell me why this update doesn't work? I think it's the punctuation but I don't know what to change. Updating an access database. All fields except empID are character. Please help!!

SQL = "UPDATE employees SET empname = '"& wrkname&"', &_
elogin = '"&wrklogin&"',
emptype = '"&Request.Form("etype")&"', &_
empDefloc = '"&Request.Form("defsite")&"', &_
empemail = '"&Request.Form("eml")&"', &_
adminflag = '"&Request.Form("adminstat")&"', &_
epassword = '"&Request.Form("epw")&"'
WHERE empId = '& Request.Form("ID")'"

objCon.Execute SQL

Reply With Quote
  #2  
Old April 13th, 2004, 10:53 PM
InsureDesign InsureDesign is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 32 InsureDesign User rank is Private First Class (20 - 50 Reputation Level)InsureDesign User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 29 m 35 sec
Reputation Power: 5
Try this:

SQL = "UPDATE employees SET empname = '" & wrkname &_
"', elogin = '" & wrklogin &_
"', emptype = '" & Request.Form("etype") &_
"', empDefloc = '" & Request.Form("defsite") &_
"', empemail = '" & Request.Form("eml") &_
"', adminflag = '" & Request.Form("adminstat") &_
"', epassword = '" & Request.Form("epw")&_
"' WHERE empId = " & Request.Form("ID")

Last edited by InsureDesign : April 13th, 2004 at 11:19 PM.

Reply With Quote
  #3  
Old April 13th, 2004, 10:57 PM
mag mag is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 6 mag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
still doesn't work - any help VERY welcome

I tried adding the ampersand - still doesn't work-
SQL = "UPDATE Employees SET empname = '"& wrkname&"', &_
elogin = '"&wrklogin&"',
emptype = '"&Request.Form("etype")&"', &_
empDefloc = '"&Request.Form("defsite")&"', &_
empemail = '"&Request.Form("eml")&"', &_
adminflag = '"&Request.Form("adminstat")&"', &_
epassword = '"&Request.Form("epw")&"'
WHERE empId = '"& Request.Form("ID")&"'"


error is:

Unterminated string constant
/web_sched/edtP2.asp, line 228


SQL = "UPDATE Employees SET empname = '"& wrkname&"', &_
---------------------------------------------------------^

Last edited by mag : April 13th, 2004 at 11:08 PM.

Reply With Quote
  #4  
Old April 13th, 2004, 11:21 PM
InsureDesign InsureDesign is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 32 InsureDesign User rank is Private First Class (20 - 50 Reputation Level)InsureDesign User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 29 m 35 sec
Reputation Power: 5
I edited the other post should work.

Reply With Quote
  #5  
Old April 14th, 2004, 12:16 AM
mag mag is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 6 mag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks so much-it worked!

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Sql Update not working-HELP!!


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT