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
- <%
- Dim objConnection1
- Dim objRecordset1
- Dim SQL
- Dim StrPrice
- Dim StrType
- StrPrice = Request.form("CompPrice")
- StrType = Request.form("search")
- set objConnection1 = Server.CreateObject("ADODB.Connection")
- set objRecordset1 = Server.CreateObject("ADODB.Recordset")
- SQL = "UPDATE Cartridges SET Price = '" & StrPrice & "' WHERE Type1='" & StrType &"';"
- objConnection1.Open "DSN=Books"
- ---------- this is where i get the error (line 17) ----------
- objRecordset1.Open SQL, objConnection1, adOpenStatic,adLockPessimistic, adCmdtable
- -----------------------------------------------------------
- objRecordset1.Close
- Set objRecordset1 = nothing
- objConnection1.Close
- Set objConnection1 = nothing
- %>
- my error :
- [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
- /Updateprice.asp, line 17