473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Using SQL to update in ASP *HELP*

1
The user enters a product in the previous page (StrType)
and then enters a price for that product (StrPrice).

I want the table in access to update the field called 'Price' with the new price (StrPrice) WHERE each records under the field Type is whatever product the user inputed. (StrType)

am i going by this all wrong ?
I'm still a rookie in ASP so here is my code :


Expand|Select|Wrap|Line Numbers
  1.  <% 
  2. Dim objConnection1
  3. Dim objRecordset1
  4. Dim SQL
  5. Dim StrPrice
  6. Dim StrType
  7.  
  8. StrPrice = Request.form("CompPrice")
  9. StrType = Request.form("search")
  10.  
  11. set objConnection1 = Server.CreateObject("ADODB.Connection")
  12. set objRecordset1 = Server.CreateObject("ADODB.Recordset")
  13.  
  14. SQL = "UPDATE Cartridges SET Price = '" & StrPrice & "' WHERE Type1='" & StrType &"';"
  15.  
  16. objConnection1.Open "DSN=Books"
  17.  
  18. ---------- this is where i get the error (line 17) ----------
  19. objRecordset1.Open SQL, objConnection1, adOpenStatic,adLockPessimistic, adCmdtable
  20. -----------------------------------------------------------
  21.  
  22. objRecordset1.Close
  23. Set objRecordset1 = nothing
  24. objConnection1.Close
  25. Set objConnection1 = nothing 
  26. %>
  27.  
  28. my error :
  29. [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
  30. /Updateprice.asp, line 17
  31.  
This is for my job, so any help, would GREATLY be appreciated !
Feb 7 '06 #1
0 2726

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Aaron | last post by:
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; ...
4
by: gj | last post by:
Hi, I'm trying to update a sql database from a web form using text boxes. I'm trying to learn C# on my own so I am at a complete loss. I created my sql connection, data adapter, dataset and data...
4
by: jay | last post by:
I am using the dataset object to add a row to a sql server database in vb.net code, as follows: dim drow as DataRow dim cmdBld as new SqlCommandBuilder(mySqlDataAdapter) ds.tables(0).NewRow()...
11
by: Dacuna | last post by:
Is it possible to use a recursive function to loop through a recordset faster? I have a table that I need to edit its contents after doing some calculation. The table has one field has an RawData...
4
by: fmatamoros | last post by:
I sometimes get the following error from an update statement in a stored procedure: Transaction (Process ID 62) was deadlocked on thread | communication buffer resources with another process and...
16
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
1
by: Sharon | last post by:
Hello All, Is it possible to update Sql Table through DataGrid. I have a DataGrid which is being populated through a stored procedure, all i wanted to do is to update one field...
1
by: MORALBAROMETER | last post by:
Hi all, I want to update MULTIPLE elements of an HTML page using Ajax. for this reason i my response is an xml document. I want to use XSL at the client side to update these elements. How can i...
1
by: gomathinayagam | last post by:
hai, am only beginer in c#... i am trying to connect database with webform. using a technique that the fields of the table and the controls in a form are named same...then i try get the controls...
8
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.