Adding, Deleting Records Using Global.asa

Can I do the following things in the global.asa file?

When sessions starts:

Add a record into my database

When session ends:

delete it where rs("sessionid") = Session.SessionID...

?

I'm pretty sure I can, but...I've heard not ALL things can be done in global.asa...

Do I create an object, and a connection? How would I do it? Since I want a database in MY database, not in memory like I've seen...

View Replies


ADVERTISEMENT

Deleting And Then Re-adding Records

I may have made a typo somewhere. I am trying to delete collections from RelProdCollection Table that has a certain record with Product ID number of __ and then readd them based on the user's choices on the edit form. Code:

View Replies View Related

Error In Deleting,updating And Adding Records Using Asp!

I got an asp page that supposed to add,delete records from access 2000 mdb file. It loads all the records but when i try to delete or update i get these errrors. Code:

View Replies View Related

Deleting A Temp File On Session End From Global.asa

I am trying to write a sub that will delete a spreadsheet file created by the web user. THis is the code I have inserted into the global.asa file, but it is not working.

sub Session_OnEnd
'delete the temporary excel spreadsheet
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(Server.mappath("temp/<%=session.sessionid%>.xls"))
Set objFSO = Nothing
end sub

I have made sure that the temp folder has permissions set for the IUSR_machinename account to be able to delete files. I am running IIS 5 on a windows 2000 server.

View Replies View Related

Problems When Adding,deleting,editing Data In The Database

actually, I have a problem while i want to add, delete, or edit a record to a database through a asp page, I can read well but when i want to submit changes using rds object , the data does not change on the source database,

I tried hard to get a solution but i think that the actual problem is only on one figure which is the server value of the data control when i use my own iis server, I do not know this value and microsoft is saying use an empty value but it does not work either.

View Replies View Related

Global.asa & Resetting/clearing/deleting Application Variables

I'm just dipping my toes into server-side scripting.

The Global.asa file seemed really nice, but am I understanding correctly that the application onstart event is fired ONLY when the server is started/re-started or when the FIRST user logs onto an ASP application?

If that's the case, then all the changes I keep making to my Global.asa file are pretty useless, right? (which seems to be the case -- i.e., my pages are not using any of the new information). Code:

View Replies View Related

Deleting Records

I am using ASP with SQL for my database.The problem I have is that even after I have ordered certain items from the shopping cart table on the webpage, I cannot remove them -
that is the entire list shows up the next time the table is opened.

is there any way I can delete the items once ordered so as to not let them show in my table?

View Replies View Related

Deleting Records

I am not sure if this is the right place to ask. but... I need to delete records where two fields in the same record are equal. I am not sure how to go about this.will this work?

strQ ="DELETE FROM Request_Notify WHERE Field1 = Field2"

View Replies View Related

Deleting Records

I was wondering the correct way to delete records from two different tables using inner join

Ex.{

DELETE tblPunchlines.Punchline, tblCast.LastName, tblCast.FirstName
FROM tblCast INNER JOIN tblPunchlines
ON tblCast.EmployeeID = tblPunchlines.EmployeeID
WHERE tblCast.EmployeeID = 3
AND tblPunchlines.EmployeeID = 3

}

Can anyone show me the correct way to do this

View Replies View Related

Problem With Deleting Db Records

I have a link on my page for each db record:

<a href="<%= strFileName %>?sc=delete&strArticleID=<%= recordset_obj("article_id") %>">Remove</a>

when i click the link, it goes to the correct "case" and will run through my deleteRecord subroutine. I checked it with output at the very beginning and end of the delete routine.

my problem is that nothing happens and i want the record to be deleted.

here is the delete routine: Code:

View Replies View Related

Trouble Deleting Records Via SQL

I have this list of records (from an Access DB) and would like to use check boxes to delete 1 or many records. I think there is something wrong with the SQL though, cause the records are not deleting when the form is submited. Code:

View Replies View Related

Deleting Records In A One-to-one Relationship

I am trying to get my code to delete a related record in a one-to-one relationship. The code I am trying is as follows:

mySQL = "DELETE FROM tblPurchaseOrderLine WHERE ((tblPurchaseOrderLine.lngPurchaseOrderLineID)="& PurchaseID &");"

myRS.Open mySQL, objConn, 1, 3

However, tblPurchaseOrderLine is related to tblAccessoryPackOrderLine of lngPurchaseOrderLineID. Do i need to reference both table in the statement?

View Replies View Related

Deleting Records From A Database

If I have an access database with the fields Title, Artist, Description, DiscNo, TrackNo, Price and ID(Autonumber)

What would be a single-page script to remove only records where DiscNo= string entered into a text field in a form?

Example: I enter into the text field "SC8200" which relates to 18 records in the database. I click submit and all 18 records are deleted. Code:

View Replies View Related

Deleting RS Records Using Loop Iteration

Can I loop through a recordset and with each record, see if the value of a field is higher than 5. If it higher than 5, just delete that record, not the whole record set and continue the loop.

I am accustomed to using a sql statement to selecting an entire recordset based on similar criteria and deleting the whole recordset in one swoop, but not this time. Code:

View Replies View Related

Deleting Multiple Records In A Database

I get this message when trying to delete:

The column prefix 'username' does not match with a table name or alias name used in the query. I am not sure what this error is. I checked all over the place for the problem.

View Replies View Related

Trouble Editing, Updating, And Deleting Records

I am having trouble with the edit, update and deleting of records. I got the codes from a user in a different forum. Now I can't find ant help from that forum. Here is a link to a zip file with the pages and database in it.

bkdphoto.com/problem.zip

Simply open the listings.asp page then click on one of the Edit or Delete labels. I am getting the following message when I do:

Error Type:

Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/Tests/New Folder2/delete.asp, line 7

View Replies View Related

Adding Records

I have a table with 2 fields, name and value

I need to be able to add multiple records quickly, for example I need to add

name value
abc 1
abc 2
abc 3
abc 4
abc 5
abc 6

etc etc, does each record have to be added separately, or is there a way I
can add a chosen number of records, lets say 10, and have the value field
increase by one each time?

sometimes I might have 30+ simple records that need adding quickly, and each
time the first records value will be one, and each record after will
increase by one, is there a way to solve this problem or does each record
have to be added separately?

View Replies View Related

Adding Records

I have a drop down which has numbers from 1 to 25

When a user selects 3 he will see 3 first name textboxes and 3 last name textboxes

the user fills them out and hits the submit button

three records are added to the table

i have a for loop for adding records

Here is my code:

View Replies View Related

Adding Different Records

Just when you think something is working, suddenly something new comes along.this is my situation: I want to add intQuantity of all records that have the same prodID. I have tried all sort of variations but I don't seem to get it. I would imagine that it must be simple, that's why I can't get it.

SELECT SUM ( intQuantity) AS ItemTotal
FROM tblOrders
WHERE prodID = ? no clue

Or can I do that in ASP? doing something like (my example doen't work)
<%= (rsOrders("intQuantity") + rsOrders("intQuantity")) %>

in the mean time I'll be looking around for an answer to my lack of know how.

View Replies View Related

Loop + Adding Records

I have loop displaying certain records depending on an id number in my sql database. What i need to do using asp is total all the numbers in one of the fields and display that as a response.write.

View Replies View Related

Adding Values From Records

I want to add intQuantity of all records that have the same prodID. I have tried all sort of variations but I don't seem to get it. I would imagine that it must be simple, that's why I can't get it.

SELECT SUM ( intQuantity) AS ItemTotal
FROM tblOrders
WHERE prodID = ? no clue

Or can I do that in ASP? doing something like (my example doen't work)

<%= (rsOrders("intQuantity") + rsOrders("intQuantity")) %>

in the mean time I'll be looking around for an answer to my lack of know how.

View Replies View Related

Adding Records To Data Base?

I have a data base that I wish to add a record to. I have many fields to ender, but I was testing my code with just one and it works just fine : Code:

View Replies View Related

Adding Records With Autonumber Field

I'm writing a database admin page in ASP. I had it adding records correctly. Then I added an autonumber field ("ID") to the table, and it stopped working. The sql I'm using is Code:

View Replies View Related

Adding Multiple Records With Checkboxes

SQL 2000 database with ASP

I've found many things "out there" regarding updating and deleting
multiple records with checkboxes but I can't seem to find anything
about adding them. A user wants to create a price list for their
client and they need to add parts to it in a separate table. I would
like to display the list of parts and the user would select multiple
parts to add to a price list by checking a checkbox and submitting the
form. Code:

View Replies View Related

Problem With Adding Records To A Table

There is something wrong with the adding code. It will add sometimes. It's a large database where I have to add records to multiple tables.

The products table doesn't work correctly. Maybe there's a typo somewhere that I don't notice. Please look at the bolded part of my code and see if you can catch something. Code:

View Replies View Related

Adding Records To Multiple Tables

i have an instance where I need to add records to 2 different tables. i know how to do it basically, but the problem is, one table is generating a key number and i need this number for the second table records.

how do i put the appropriate records into the first table, grab the id number and insert the records into the second number? the information is coming from a form. i'm developing in an access db but will be moving this to an ms sql db before it goes live.is there a stored procedure that might make this easier? i know nothing about stored procedures.

View Replies View Related

Adding Records To Tables Via Dropdown Boxes

I have a form that uses Code:

<select name=player_id multiple>
<option player_id="<%=player_id%>"><%=FName%> <%=LName%></option>
</select>

To create a drop down selection list. What I want to send to a table is FName and LName instead of the ID. Any hints on how to do this.

View Replies View Related

Adding Records With Client-side Excel File

With ASP, how can I automatically add records to a database with an excel file residing on the user's machine? Assuming the excel file has the same field names/datatypes/order as my database table's fields.

View Replies View Related

Global.asa :: Assign Diffrent Global.asa To Each Application

I have one application folder containing all ASP code files. I want host multiple sites pointing to same code. Can I do this ? If YES then how I can assign diffrent global.asa to each application...

View Replies View Related

Global.asa :: Combine Many Global.asa Files

I have added a db driven marquee to my site and need to combine the global asa's to 1 global asa file. Code: ......

View Replies View Related

Systematic Updating Of Records Depending On Amount Of Records In Another Table

The problem concerns 2 tables, cart_products and cart_shoppingcart.

Cart_products contains all the product data (eg, prices, product's key name, etc), but most importantly, it contains the quantity of stock (prod_quantity) for each item.

cart_shoppingcart contains all of the user's items in their shoppingcart, including those that are part of an (customer) order; these have the order_number to differentiate from those that aren't in any order (their Order_number is 'no_order', the others have the order number).

Now, what I want to do is this:

For every item in the order (ie, every entry in cart_shoppingcart that matches the username and order number), take the quantity (x) the customer is ordering, then take the quantity of stock remaining (y), then subtract x from y to create the new stock level (z) and update the appropriate record in cart_products with z (all this with SQl preferably).

I was thinking of using a Do while loop, but realised that it wouldn't work as I'd have to use several SQL statements and then I'd run into a problem the minute ASP reads "objrec.movenext".

View Replies View Related

Pulling Records From End Of A Database Or Inserting New Records To The Beginning

I'm trying to pull the last 5 records from my database.

<% j=5
rs.MoveLast
While ((j>0) AND (NOT rs_article.BOF))%>
''Execute HTML and data insertion here

<%rs_article.MovePrevious
j=j-1
Wend%>

Everytime I attempt to run this code, I recieve an HTTP 500- Internal Server Error. It tells me no more than that. I know that my connection settings are OK because when I move forward through the database (first five records), the code executes without error. And yes, my Cursor type is Dynamic.

Alternatively, I would also like to know how to add new recordset to the beginning of a database rather than the end.

View Replies View Related

Deleting

This code works fine, it deletes the record that already exist in the database and displays a message to the user the record has being deleted.... but it also it has a problem, if you enter a record to delete from the database and this record does not exist it displays the message that the record has being deleted, while instead it should display an error that this record does not exist in the database.

Code: ...

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved