I have a .asp page that displays an HTML page: view_msg.asp
There is a link (anchor tag) on that page that when clicked, sends the user to another page. I would like to also execute a MySQL query when that link is clicked. The DB is already open and connected to the page. The current current tag looks like this:
and the MySql command I want to send is:
UPDATE Messages SET `fromDisplay`="N" WHERE idMessage=" & idMsg "
In english: When someone clicks on the link I want to execute a MySQL command to set the field value to N... how do I do that?
I know this is a very rookie question - but I don't know enough about asp to know how to execute the command here the way I want. Do I have to turn the image/button into a <FORM> 'submit' button</FORM> and use a redirect? Or, would I use an ONLCKICK. What would the correct syntax be?
ASP VB. I have 1 recordset where I pull the order in. I have another that I pull in the on-hand qty. I used a repeat region and now I have it working to display the new on-hand qty. Now I just need to update the recordset with the qty on hand.
The code below is a bit more representative of what I'm doing:
<!--#INCLUDE FILE="Database_Open.asp"--> <% sql ="SELECT * FROM CustomerBase WHERE " & _ "UserName='" & username & "' AND " & _ "SECRETWORD='" & password & "' "
RS.Open Sql, Connection, 3
IF RS.EOF THEN 'redirect code here ELSE RS.Fields("Fullname").value = "Bob" RS.Update %><!--#INCLUDE FILE="Database_Close.asp"--><% Response.Redirect ("Menu_Account.asp") END IF %>
I've always sticked to MS SQL Server because it doesnt give me troubles that I have with MySQL. But decided to give it another shot.
I use "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=myserver; DATABASE=mybase; UID=myid;PASSWORD=mypwd; OPTION=3" connstring to connect to my database online.
I can read and get records off the database easily, but everytime I try to update records using recordset
rs. open "SELECT * FROM MyTable", Conn, 3, 3 rs("Content")="Hello" 'text datatypers.update
It always generates error. Can some1 help me with this?
I am storing dates in a mySql database in the format yyyy-mm-dd. Now, I have set up so that this field is insert by a form.
It isn't very user friendly to have to type yyyy-mm-dd, how can I set up so that the user can enter format dd/mm/yyyy and it will automatically insert into the database as yyyy-mm-dd? I am using Dreamweaver MX 2004 and ASP.
i just wanna know how to be able to update certain fields without touching the others
for example if the form has 3 fields description, name and age....
if i wanted to update the database from these fields, but only update the description while leaving the ohters as they are, which means blank fields in form...
now if i do that on my form, it will clear other 2 fields in the database and only update the description... how can i fix that so that when there's blank fields in form in won't clear the data in database ?
This is probably a easy answer for you guys. Just trying to find the easiest way to do this. I want to click on a link and update a field in a recordset, but don't want to leave the current page.
HrngID is the link. I want to change the Canceled field from a 1 to 0 when clicking on the link . I know I can use a onclick event, but not sure if these is an easier way. Can I do like a onclick and run a SQL statement on one line?
I am using Windows XP profesional and Access 2000 but are experiencing problems updating or adding new records to my database with asp. I have installed IIS 5.1 on my computer but also on my internet site I am having problems to add a new rec. or update one.
The error message is something like:
< Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query. >
I get this message on my web site as well as when I try some new tests, with other databases, on my local PC's IIS. Does anybody know what is wrong? It used to work okay earlier on my web site?
i can add the record in first table but cant get it to do with the second one one of the field in the first table the "mktid" which is the primary and is a forgeiner key in the second table how can i have it insert or update in the second one Code:
add/update a record in first table and 2nd i can add the record in first table but cant get it to do with the second one
one of the field in the first table the "mktid" which is the primary and is a forgeiner key in the second table how can i have it insert or update in the second one
I have a table in the db and one field in the db is an email field various records can have the same email address in. When an email address changes from x to y I want to be able to change an email address x in every record in the table to y, how would I do this?
I have to compare 2 tables: orderA and orderB, if the record exists in both table orderB and orderA, just do a update to the quantity field in orderB (add orderA.quantity to orderB.quantity). Otherwise a new record has to be insert into orderB.
Do I have to loop through the recordset of orderB, then use select statement to see whether the record exists in orderA or not, and determine whether to update/insert record? I am using Access database. I just afraid that looping through each record in recordset (maybe >=30 record each time) would make the transaction getting slow (or even hang??). Can I do this in one SQL statement?
I'm new to ASP so I'm using DWMX as a crutch. It created the db connection and recordset code for me and all I want to do is have the page update the db with the result of a variable.
In plain English, I'm trying to update a field called Score in the table quizOne with the results of the variable score where the username field matches the session variable MM_Username. The recordset is called update_score.
Based on other tutorials and forums, I tried this: ....
I have a form on a website for logged-in customers to update their contact details, when the customer update their contact details it should update the record in the database and at the same time the updated contact details should be sent to me by email.
I'm not an expert in ASP 3.0 and therefor I'm using dreamweaver 8 to create asp pages(ASP 3.0 VB), but dreamweaver does not have such kind of fuction(server behavior) to do this and so I have to create this by hand.
Now I already have page with the form that updates the record in the database, and I also have another page that does the mailing(CDONTS), first it updates the record in the database and in dreamweaver I have set "after insert the record go to mail_processing.asp" , but this does not work.
I can only get one to work, either only update the record or only mail the form data.
How can I make it to update and mail at the same time?
I have made several Access-based CMSs but now I am using SQL Server. I can read the records but my first attempts at writing are resulting in new records (with new ID) but all the fields are null.
I am posting the data from a form to the same page and an if /then statement catches the flag in the URL and runs the update script below. All the field names are correct. Code:
I need to alter a dremweaver Update Record function but am a bit lost with it. I basically need to take the values from 3 drop downs that let you selct the date (day, month year). I've written a variavble that adds these together to make a date:
I have a main window which shows all records from a table. When a user clicks on "Edit" for a record, a popup showing information of the selected record is displayed.
The user then changes the information on the popup and clicks "OK" button which calls an ASP page to update that record in the table. Everything works with no problem up to this stage.
My problem start after the update process. I need to know how to close the popup and then refresh the main window showing the updated information....
Have you ever been on ebay-You know when you are checking a persons feedback history, you see a href link to go and see that particular item.
I would like to do the same. If i have a table which i populate with information, if the user clicks on view, i would like to go and show that particular item on another page. Ebay has one unique key (item number), unfortunatley i have a composite key.
How can i do this by adding a href in an asp table and also by having the ability to go directly to the full information about that specific item?
I have done something similar in vb but i used a mshflexgrid but i don't think thats a possibility in asp.
I would like to have a link that when clicked, sends info to an ASP page to process, but does not submit the entire page. This way, the user will click on a link and will not be taken to another page, but precessing will occur. This is mainly for a 'Rating' Application. Amazon.com does this and I want to know how they do it. Here is the link to the amazon page (you may need to be logged in) http://www.amazon.com/exec/obidos/t...5480771-6490552.
I'm using W2k Pro, ASP 3, IIS 5 & DWMX 6.1 and code in VBSCRIPT I currently use the <BASE href=XXXX> in all my pages and just read that this tag is no longer supported so will soon vanish I have a couple of sites that I'm working on and to make all my links work right etc I need to use the base href tag
all my links are like <img src=images/mylogo.gif> or <a src=info/info.asp>Info</a>
Now my problem is how else would I design my sites if I cant use the Base href tag so the site would work both on LOCAL & REMOTE servers as needed in the above paths?I'm sure other people develop on a WIN 2k PRO system where you canonly have ONE site (c:inetputwwwrooot) Which was fine when I only had one site... but when I needed a second I had to change my first to use the Base href so I could check the sites out locally (offline) before uploading them to a live server.
Is it possible to use If Then statements in an a href tag? What I am trying to do is I am using a server side include page of navigation inside of a content management system. I have limitations on what I can manipulate and change. So just using style sheets won't do me the trick. I want to have a navigation link change a different color when you are on that section. I have the menu expanding also using if then statements. When a variable is passed somewhere else on the page as true, the menu expands. I figured I could use this in the same way to make the link change colors. I want to do something like:
<A href="#" <% If Variable_name then%> id="link <% end if %>>Link Here </a>
Is that possible? I know that i can do an If then statement and have 2 different links, one with the id and one without, but I wanted to see if I could simplify it at all. I'm not the best with ASP so there might even be better ways then that...I was just using from the little that I knew.
Basically what i want to happen is that when a user clicks on the web link that it opens the meeting room which is in a public folder in outlook application (not the web interface outlook.