Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Update Script

Status
Not open for further replies.

meltingpot

Technical User
May 11, 2004
118
GB
Hi .. getting the following error from this script

ERROR . Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
Ive checked the names of the fields ect and all seems well ??

All input values are text.

Head Script ..
<% If Request.QueryString("update") <> "" Then %>
<%
strConnectionString = "dsn=jsastc"
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.Open strConnectionString
strSQL = "UPDATE Boats SET PositionSea = '"&(Request.QueryString("update"))&"' WHERE HMSTC = "&(Request.QueryString("HMSTC"))&""
cnn.Execute strSQL,,adCmdText + adExecuteNoRecords
cnn.Close
%>
<% Else %>
<% End If %>

Body Script ....
<A href="active_boats.asp?HMSTC=<%=(mhstc.Fields.Item("HMSTC").Value)%>&update=At Sea"><img src="../images/latest/buttons/position_sea.gif" width="30" height="20" border="0"></A>

Help --- my brain is melting

Cheers
 
Give this a try .. it'll give us somewhere to start:
Code:
<% If Request.QueryString("update") <> "" Then %>
<%
strConnectionString = "dsn=jsastc"
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.Open strConnectionString
strSQL = "UPDATE Boats SET PositionSea = '"&(Request.QueryString("update"))&"' WHERE HMSTC = "&(Request.QueryString("HMSTC"))&""
response.write strSQL
'cnn.Execute strSQL,,adCmdText + adExecuteNoRecords
'cnn.Close
%>
<% Else %>
<% End If %>

That error seems to indicate that it's TRYING to update a record but it can't find any to update based on that WHERE clause (which makes me think the request.querystring("HMSTC") isn't what you think it is).
 
Is that a nice way of saying its probably empty?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top