Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 8th, 2004, 04:43 PM
nsr nsr is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Alabama
Posts: 3 nsr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to nsr Send a message via Yahoo to nsr
Simple query? Update Help Requested

I've been reading through various threads on this board, and seeing as how I'm new to Access/SQL on the web a lot of this is over my head. My problem might seem simple to someone here. However, I'm hoping that maybe some of you might be kind enough show me what I'm doing wrong.

I have a database on a webserver, and have had no problem setting up templates and queries to return results for site visitors. I am now experimenting with updating and deleting records from the database and have run into a snag.

I am basically allowing a user to select a record via a query, and want to be able to allow them to update the data. I have setup a template which inputs the existing data into an html form. The user would then be allowed to see the existing values and update any that need it, or delete the record altogether.

I already have the delete working, but I have been unsuccessful in getting the update function to work. In short: I need to be able to update multiple fields on a single record.

The database is in MS Access 97 format. (don't ask) And this is pretty much what I have in my .IDC file:

DataSource:testdb
Template:update.htx
SQLStatement:
+UPDATE testdb SET Name='%Name%' and Status='%Status%' and DateJoined='%DateJoined%' and Locality='%Locality%' and Email='%Email%' and Notes='%Notes%' and TrialDateStart='%TrialDateStart%' and TrialDateEnd='%TrialDateEnd%'
+WHERE ID='%ID%'

I have tried "eq" instead of "=", I've tried with a SELECT statement and without. I have been unable to produce any results, and this is the error message I'm getting:

Error Performing Query

* [State=37000][Error=-3503][Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.


Anyone have any ideas?

Thanks.

Reply With Quote
  #2  
Old March 8th, 2004, 10:24 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
What server side language are you using to do this?? If it's ASP/PHP - there are a few tutorials on this DevArticles on how to perform inserts/updates - there are quite a few on the web in general too, as this is one of the first things you need to know for web development.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old March 10th, 2004, 10:30 AM
nsr nsr is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Alabama
Posts: 3 nsr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to nsr Send a message via Yahoo to nsr
Quote:
Originally Posted by stumpy
What server side language are you using to do this?? If it's ASP/PHP - there are a few tutorials on this DevArticles on how to perform inserts/updates - there are quite a few on the web in general too, as this is one of the first things you need to know for web development.

I'm using just HTML.

In fact, I had looked all over the net for examples, and most of what I found were this simplified version:

UPDATE table_name
SET column_name = new_value
WHERE column_name = some_value

I have not yet found any more complex examples.

Last edited by nsr : March 10th, 2004 at 10:32 AM. Reason: left out something

Reply With Quote
  #4  
Old March 10th, 2004, 10:37 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
You can't be using just HTML. There has to be a programming language behind returning such results.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #5  
Old March 10th, 2004, 06:53 PM
Brick1235 Brick1235 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 31 Brick1235 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Uhmmm I think you can use scripting for that. HTML alone... uhmmm.... never heard of it. Maybe HTML + ASP or + PHP
something like that... would be good.



NHK

Quote:
Originally Posted by nsr
I'm using just HTML.

In fact, I had looked all over the net for examples, and most of what I found were this simplified version:

UPDATE table_name
SET column_name = new_value
WHERE column_name = some_value

I have not yet found any more complex examples.

Reply With Quote
  #6  
Old March 12th, 2004, 11:01 AM
nsr nsr is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Alabama
Posts: 3 nsr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to nsr Send a message via Yahoo to nsr
No, I'm not using ASP or PHP.

The server is running MS XP, so we have IIS setup. The access database located on the server is queried from the website using SQL commands in the IDC file.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > Simple query? Update Help Requested


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