Hi there,

I need help in the following situation.

I have retrieved some records from my Access table by giving a simple select statement and have just simply displayed these records on the page horizontally.

Also i have added a anchor tabl to each record so that when they get displayed i click on them and they take me to the other page.

There is a field called order id which i need to store somewhere and basically use this order id in the next page.
The reason for doin so is i want to use this order id for performing an update on the order i have clicked so that it gets updated.
Something like this:

Update tblorder Set AgentName(whatever user selects in the dropdown) where orderno="Value from the previous page"

I can either do an update or insert..which i am confused..so need help in this too.
But main thing is how should i call the order no and use it in my query on the next page/form/screen?

in your anchor tag href attribute concat the order id into the querystring so your links are:

<a href="/form.asp?orderid=123">order</a>

in the form.asp you have;

Dim orderid
orderid = Request.Querystring["orderid"]

sql = "update blah.. where orderid=" & orderid

:
:
etc...

Thanks!
I did what you told me to do.My Query looks like this:

queryl="UPDATE tblorder SET AgentName = '"& Request.Form("txtAgentName") &"' where OrderNo='" & OrderNo & "'"


Its giving me the following error:
Microsoft JET Database Engine (0x80040E0C)
Command text was not set for the command object.


Any idea what is the solution to this???/

-Smita

You have declared a string and assigned a SQL update query command to it, but you havn't assigned it to the text property of your comand object

Post all the ADO code please, there are many ways of doing it so I have no idea without seeing your connection and command statements

hi smita , ur confused about update and insert queries. There are simple actually, update is used when u want to change any details alredi added in the table. Insert is used for adding new values or data. Coming back to ur question, well , Request.Form("txtAgentName") in ur line of update query should be replaced by a variable which is assigned to Request.Form("txtAgentName"). For ex: agent , agent = Request.Form("txtAgentName"). this is my solution. : )

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.