Record Values Are Being Passed
When i submit this form all the record values are being passed to the next asp page. But i want only those records which the user has changed in this page.
View RepliesWhen i submit this form all the record values are being passed to the next asp page. But i want only those records which the user has changed in this page.
View RepliesI have a record set with returns the following :-
"stringId","typeId","count"
e.g.
A, A, 3
A, B, 7
...
B, A, 19
B, B, 3
...
I can't change the query I have to work with this record set as it comes from a view which is the only DB object I can access.
I could requery the view using
SELECT SUM(count) FROM table WHERE stringId = 'x'
however this is very very slow and results in a lot of round trips to the SQL server.
What I need to do is get totals for each stringId and I am puzzling over the best way to do this in ASP.
I then need to use the totals I have calculated to work out percentages of the count column. Code:
A page displays the Product literature that a customer can request to receive by postal mail by clicking a check box. The literature selections are created by a dynamic record set based upon what the company enters into the Literature table (currently 10 selections). The checkbox form tags are:
<input type="checkbox" name="LiteratureID" value="<%= rs("LiteratureID")%>">
LiteratureID is the Access autonumber primary key field. I can use the LiteratureName in the "name" attribute if it is easier.
The form processing page needs to Insert each selection into its own record in another table. This "requested" table also inserts the database ID for the customer that is created after first inserting the customer contact info. In other words the "requested" table needs to record the customer autonumbered db ID and each selected checkbox value.
Here is my current code:
when guarding against sql injection attack from modified form or
querystring variables is it enough to strip out just apostrophes...if the
variable USERNAME is the name of a text box passed to a script is the below
always safe...
q1="select * from TABLENAME where username='" &
trim(replace(request("USERNAME"),"'","''")) & "'"
I've never seen this before. I am new to querystrings, as just using hidden
fields and the POST method has been more than adequate for me until
recently. But I started using the GET method, and I noticed that when I
clicked the submit button, it gave me this for a URL:
http://localhost/DisplayTickets.ASP...nsearchTSE.y=11
The thing is, selectTSE and Status are the two <SELECT> boxes, so I
understand them being there. But why is is telling me the x and y
coordinates of where I clicked the button to submit the form?
I should add that the submit button is an image, not a regular button.
This doesn't hurt anything, just wondering why it's there. And maybe it will
hurt something later on; I don't know enough to say.
can cookies be passed from a pop up "secure folder log in" window, provided by my hosting company? As I would like to display a welcome message with their name when they log in.
View Replies View Relatedwhen i try passing a numeric value as a string("0004") using asp to a stored procedure, the value is stored as 4 and not as 0004 in the table. In the table and stored procedure the value type is nvarchar.
View Replies View RelatedI have a page that passes a variable in to an sql query
It parses the string (a date) for month and year.
It works when i use the date() function Code:
I'm trying to pass paramter values to another .aspx page via a querystring. The record in the db table looks something like this lahlahlah. The value that gets passed looks like this lahblahblah. So basically the is not getting passed.
Here's what my querystring looks like: Code:
i need to add a variable brought into the
script like: script.asp?variable=var
and i need to make it for use in
var1 = request.querystring("var")
mySQL = "SELECT * FROM members WHERE nick = 'VAR1'"
can anyone tell me how to do this?
I am using SQL SERVER 2005 and ASP.
Would anyone be kind enough to give me a solution to the problem below please?
If for example in the stored procedure looks like this:
-- Initialize the SQL Server XML stored procedures
EXEC sp_xml_preparedocument @xmlDoc OUTPUT, @xmlString
Insert into @TableBook
SELECT * FROM OPENXML (@xmlDoc, 'books/book') WITH
(
bookNameVARCHAR(100) 'name',
authorVARCHAR(100) 'author'
)
The question is supposing there is a node called 'Surname' but I am not adding 'Surname' to 'Author'. If I want to check 'Surname' value DOES exists and I want to replace it with 'Author' or if 'Surname' does not exist, just use 'Author' node instead.
I am not sure how you can use IF statement to check a node and put the value into SET @surname and then put something like author VARCHAR(100) '@surname' OR author VARCHAR(100) '@Author'. Just like switching it around.
I would like to clean up my mailing list by changing the URL I use at the moment which is in the format
www.mysite.com/view_pic.asp?pic_number=123
To be
http://www.mysite.com/view_pic.asp?p...il=bob@bob.com
it would then insert the email into a table, collect these for a while and only see these as active members.Any ideas how to do this, I've tried a few things but no luck.
I am trying to work out the length of time that a page was opened till it reached another page, I amusing the script below Code:
View Replies View Relateddoes anyone know why my session number doesnt stay the same when i pressed refresh?
it works on w2k, but not on w2k server
my programmer thinks that the IIS is not passing the session back to the client. is there a way to check or any other alternative for sessions?
I am creatiung a track record website which displays a list of branches and how many people are available at each individual time slot.
I thought the best way to update would be to create a link which passed two variables, the branch and what time slot. This would then be retrieved int he book.asp page which then would knock one of the current count. I came up with the below page: Code:
my ASP code creates a form and an array of chekbox with this statement response.write "<input type='checkbox' name='chkProduct" & Cstr(counter) & "' value='delete'>" all goes well and i also have a button that points to a VBScript function passing one parameter the counter start value so i can loop throught the checkboxs on the client side and determine if checked or not.
Ok i can display my command "document.frmProductCart.chkProduct & (Cstr(counter)) & .checked" as a string in alert but cannot make it as a command like it should be, anyone got any pointers ?
I have created a database connection function which I use to open my database connection and recordset and another to close it. Easy stuff I know. The problem is this.
I want to be able to create database conenctions and recordsets specifically when I call the function. For example Code:
I have a ton of TD attributes that have to be changed based on the
data in the DB. All TD elements are ID and runat=server.
Changing the attributes of a SINGLE TD is simple:
<td id=thisTD runat=server>
thisTD.Attributes.Clear();
thisTD.Attributes.Add("Class",reader["thisTD_Class"].toString());
Now, say we have 100 TD elements with IDs TD_1 to TD_100
I have not been able to find a way to (essentially) say:
for(int i=0;i<100;i++){
"TD_"+i.Attributes.Clear();
"TD_"+i.Attributes.Add("Class",reader["TDClass"+i].toString());
}
in J-Script, I could do it by Eval() or about eight ways through the
DOM. It seems crazy to me that if I can access the Attributes of a
specific element directly by ID (thisTD.Attributes), I couldn't also
access it by reference.
But I have been able to find NOTHING to indicate how this may be done.
Obviously, my problem is not limited to a single attribute, or else I
would have just typed them all out by now. Trouble is, there is a lot
of logic that must be applied to the data before setting the
attribute. Without being able to iterate or loop by reference, I will
be typing for ages just to change some freaking classes.
I have encountered some strange behaviour when using the XMLHTTP Request object in Javascript to return xml from a C# Webservice Method. I create a SOAP envelope and send it off to the Webservice, which I have debug points in, which when hit I can see that all the parameters are coming thru as null....
View Replies View RelatedI'm getting this error message: Error Type:
Microsoft JET Database Engine (0x80004005)
You cannot add or change a record because a related record is required in table 'employees'. Code:
I want to call a recordset so you can edit the details and then obviously pass the parameters onwards into the db. However, the user guide just says this:
To process other fields in the form, use the Form collection of the upload object the same way you would use the Form collection of the Request object. For example, if your form had a text element named UserName, your processing code would include: Code:
i need to convert the escape values which are by mistake updated in DB.
example:
this is a sample text string
is updated in DB as
this%20is%20a%20sample%20text%20string
here %20 is the space.
like wise there are many entries for :,'
is there way that i can update all this in a update statement?
or use asp to to update the records?
I have an insert record form that posts fine to a db which automatically creates an ID how could I get the next page to do a preview using the ID just created by the DB to go to the right record?
View Replies View RelatedI have a .asp page which lists a date, then a bunch of record lines for data that falls within that date, then the next date and it's bunch of data record lines. e.g.
Ship Date: 04/06/04
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Ship Date: 11/07/04
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
What I want is:
Ship Date: 04/06/04
1: Data xxxxxxxxxxxxxxxxxxxxx
2: Data xxxxxxxxxxxxxxxxxxxxx
3: Data xxxxxxxxxxxxxxxxxxxxx
4: Data xxxxxxxxxxxxxxxxxxxxx
Ship Date: 11/07/04
1: Data xxxxxxxxxxxxxxxxxxxxx
2: Data xxxxxxxxxxxxxxxxxxxxx
3: Data xxxxxxxxxxxxxxxxxxxxx
How can I get these numbers printed againsts the records ?
I have a variable SET which has the value Of 1, 2, 3, .., N.
SET=val1, val2, val3, val4, ..., valN
What is the commend or procedure to extract individual values, val1, val2, ...
I'm trying to pass a parameter from a for loop to the nested while loop
but only the first counter is passed. Here is the code:
I want to download record set from my SQL database as csv format but in ZIP file .I can download as a csv file now ..But i can't put that in zip file and download.
View Replies View Relatedhow to deal with multiple recordsets on the same page?
It's gotta be something small and clear so I could understand.
Somewhere I've read that multiple recordsets are not allowed when using Microsoft Access Database?
I am looking to
have some sort of SQL Trigger maybe? I have a field called 'dateActivated' and 'isActive'I'm looking to somehow say when dateActivated + 6 months then set isActive = false. I want this to
be automatic. I am using ASP/VBScript if this somehow matters.
I have a form on an asp page which is used to add additional users to
the DB, i.e. adding a UserID (PK on table), Password & Email.
The companies are allowed a max of 3 users. If the company only has
the default 1 user and wishes to add another 1 or 2, then the form
displays the current user details, not in text boxes as this is not an
adit data form. The additional user/s can be entered into 1/2 rows of
text boxes, user 2 & 3.
If they decide to add 2 new users, how do I add the additional 2
records to my db table on submit ? Code:
i am tryin to run a search on a db and am using a like statement which works fine but i want to select what it finds and also the next 9 records any idea on how to do this
View Replies View RelatedIs there any way to change the following code so that when it's the second last record in the set it doesn't put UNION ALL at the end? Basically, is there a way of saying:
if SecondLastRecord then
I don't know how many records there will be, so I can't count down from 7 or anything.
Code:
Every time I try to ADD a new record from my asp page to SQL table, I got this error:
Microsoft OLE DB Provider for SQL Server (0x80040E2F)
Violation of PRIMARY KEY constraint 'PK_Cancelled_Classes'. Cannot insert duplicate key in object 'Cancelled_Classes'
Here is the Insert statement:
Sql="INSERT INTO Cancelled_Classes (yrtr, cou_id, cancell_date, Message)" sql=sql & " VALUES " sql=sql & "('" & Request.Form("yrtr") & "'," sql=sql & "'" & Request.Form("cou_id") & "'," sql=sql & "'" & Request.Form("cancell_date") & "'," sql=sql & "'" & Request.Form("note") & "')" '
conData.Execute sql