How To Declare Session Variables And Use In Insert And Update

how to declare session variables and use it in insert and update sql statements... the scenario is I have:

2 html forms
2 ASP FILES

I am able to trap data from the first form into the acces table..but my second form(which is continuation of first form) has a update query....(ie...it shld update the same record the one inserted from the 1st form )..both the forms work on table in access db

its an annonymus...questionnaite...therefore i am not trapping any user name or login id...but the requirement is the survey made shld be unique....as in no user shld be able to answer the questions twice.

View Replies


ADVERTISEMENT

Update Session Variables

i got a quick one for you guys. i've this session variable that is updated by calling a server method (i set this value when the user hits a submit button in my form. The server method is called when i load all my asp forms.). I'd like to be able to update this session variable, without being forced to submit my form or refresh my form (something that will call my server method each 2 min lets say, without refreshing my page or submit)...is there anyway to do this??? Maybe a remote scripting with the setinterval() method?? but i'm
having trouble using this with XP and IE 6!

View Replies View Related

Insert And Update In Asp

this programe is read date for excel and export to mdb,if there exist the BID in mdb then update the date,else inert the date to mdb. Code:

View Replies View Related

INSERT/UPDATE

I have a form that pulls existing information from a database and allows users to edit it. Every field can be left blank if the user wishes.

I am having an issue with determining which SQL statement to run. There has to be an easier way to do this then what I am doing. For each filed I process the data this way:

SQL2="select * from 1985ClassList where MailingListID =" & Session("EID")
set aData = oConn.execute(SQL2)

Code:

View Replies View Related

Asp Sql - Check If Update Else Insert..

I'm using a database to store the products in a basket.

It's this scenario:
A visitor already has some products in his basket and wants add some new ones.

Now, first I want to check if the selected products aren't already in the database.

1. if they are -> update the product when the amount number is changed
2. if the product is not in the database then insert it.

I'm stuck at the point that I can't retrieve if the database is updated, so I can either stop the query or insert the new product.

Java has a statement like getUpdateCount(), but ASP/VBSCRIPT??

I want the fastest solution, i dont want to retrieve the data twice and compare them to check if it changed..

View Replies View Related

INSERT/UPDATE Error In ASP

I try to do an INSERT statement throught my ASP to add records to my Access DB. However I get an error when I execute this. The code in ASP is -

strSQL = "INSERT INTO tbl_psm (LocID, Week, Month, Year, Rating, Remark, Action, SubmittedDateTime) VALUES ('" &cint(intLocid)& "', '" &cint(sWeek)& "', '" &cint(sMonth)& "', '" &cint(sYear)& "', '" &cint(sRating)& "', '" &sRemark& "', '" &sAction& "', '" &formatdatetime(date,vbshortdate)& "');"

objConn.Execute strSQL

I get the error page Code:

View Replies View Related

Insert And Update Error

I am submitting a comment box from a form into a database field that I have declared as text (16). When I type in a small amount of information, it submits just fine, but when I enter a substantial amount of data then I receive an error. I've tried different field types, but I keep getting the same error.

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 's'.

View Replies View Related

Insert/update Record

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?

View Replies View Related

Insert And Update The Same Time

I want to insert the element selected by the user from the drop down box in the DB(Access).Once the user hits submit i want it to insert this in the DB + i want to update one of the fields from True to False . how can i perform both these at the same time?

View Replies View Related

After Insert - Update Another Site

The data that is entered into my website needs to be sent to someone else. Currently it is being put into a MySQL database. In addition to this, a third party needs this information. They have something set up on their website where I can do this:

https://www.domain.com/update.exe?src=username&data=Smith,John,5,12,Rose,Charlie

I have no control over domain.com. How can I update the record, send the data to this URL, and then redirect the user back to the default page? Right now it just inserts the record and then redirects to the default page. I'm unsure as to how to do the URL bit. I would prefer if the user did not see the domain switch.

View Replies View Related

Multiple Insert/Update

After the page (transactions.asp) loads I want to allow the user to enter the number of transactions into the provided textboxes. Then, when the user clicks submit, I need to have all the hidden fields as well as the number of transactions values inserted into the transactions table of my database?

I have attached the database should you have any questions about the db table values and fields. Please let me know if you have any questions or need more information or files.

View Replies View Related

Insert / Update / Delete

can u tell me of a simple script i can use to do the following. I want a textbox to add a entry to the database with a submit button, then below all that the current database entrys are listed below also in textboxes with a UPDATE and DELETE button beside each entry.

View Replies View Related

Insert And Update Excel Data

I didn't know how to use asp to update or insert the excel data ....

View Replies View Related

Update/Insert On MSSQL Table Using ASP Forms

I have a problem that it's bothering me for some time now and i will need a lot of help from you. I don't know how easy or difficult it is to be done but i would appreciate any help.

I have an mssql 2000 db with table "table1". Attributes for "table1" are:

ID (Primary Key)
field1
field2
field3
field4
field5
field6
field7

I'm trying through DreamWeaver MX to create a form through ASP and Text Fields, so that i can update "table1" through the form and also on another page to show the results of my table.

I have created a form which will be accepting 25 rows, each row having field1, field2, .., field7.

I cannot seem to get it to update "table1".

Any ideas how this can be done?

View Replies View Related

ASP - Date Formating MySql Insert/update

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.

View Replies View Related

Executing Sql Command -- Insert, Update And Delete

how can i make the function return true only if the execution is successfull (see bold red below)? Currently the function is returning true wheather it is successfull or not. Code:

View Replies View Related

Javascript Update Asp Variables

I know you can enter asp variable values into javascript functions

javascript_function(<%=asp_variable%>);

But can it go the other way? Can I take results from a javascript function and use them to update an asp variable? I would like to do the updating inside the function because it will be an onclick function.

View Replies View Related

ASP Variables And INSERT Statement

Can any one tell me what is wrong with this insert statement:

sql = "INSERT INTO Questions (Question,SurveyId,CatId) VALUES ('" & question & "','" & surId & "','" & Sig &"') "

and why when I print it to screen, it shows this:
INSERT INTO Questions (Question,SurveyId,CatId) VALUES 'this si a test','38, 3','');

I have used similar and it works, they are the right values bit wont work..?

View Replies View Related

How Can I Insert Variables Into SQL Server DB

I am trying to insert three variables into my table in my asp program. Can someone please tell me if my syntax us wrong. I keep getting this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 3: Incorrect syntax near '&'.

/credFeesEdit10.asp, line 735

Here is my insert statement: Code:

View Replies View Related

Tracking Session Variables From Outside The Session

I want to create an administration page which lists all the current users who are on the site at the moment.

I know coldfusion has this feature built in using the SessionTracker class... does ASP have something similar? If not... is there any way I can just iterate through all the session files on the server...?

View Replies View Related

Insert Dates In Sql Query And Other Variables.

Here is my delima im hoping you can help me with. My code currently works fine. However I want to make some modifications to it to get that best possible outcome for my client(Taxi company). Here is the code logic:

The code code currently has one text field which takes a number(Taxi number) and returns all calls assigned to the taxi number inputed in the text field and returns all, canceled, and pickedup calls by said taxi number within the CURRENT DAY. Im trying to find out how i can input a taxi number and get returned calls from PREVIOUS DAYS also preferablly going back one WEEK to a MONTH. I hope im clear. If not please inquire for further clarification.

Heres my actual code:

View Replies View Related

Update Database Using Variables Passed Through Browser

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:

View Replies View Related

Syntax On Passing Variables From Email Form To Insert A Database...

I'm having a problem with passing variables inserting to my database. Here's what I'm doing. I have a page where the user selects a team member (this is fine) Once the team member is selected I have the variables on the form send and email to all supervisors and the member selected (this is fine also) BUT, I'm having problems inserting the emailed information to my access 2000 database after is email. Can someone guide me in the right direction.

View Replies View Related

Update Using Session Variable

I have looked and just can't get my head around any of it...maybe that's the problem when using Dreamweaver as it seems to put a lot of unnecessary code in!

Anyway, I have a user login page and i'm creating a session variable called Session("sessUsername")

I want to give the user the ability to change their password but I just can't do it.
The form has 2 textboxes to enter the new password twice (just as a check nothing more), how do I do the update where the Username = Session("sessUsername")

I hope this makes sense, here is the code that I have upto now. Code:

View Replies View Related

Declare Arraylist Using

may i know how to declare arraylist using asp?

View Replies View Related

Declare A Variable

Using Option Explicit necessitates that any variable used has to be
declared (Dimmed) explicitly but it DOESN'T necessitate that the
variable HAS TO BE DECLARED BEFORE the variable is used. For e.g. the
code below, which first uses the variable "str" & then declares it,
works fine:

===============================
<% Option Explicit %>
<%
str="Hello World"
Response.Write(str)
Dim str
%>
===============================

Why so? If I am not mistaken, usually it's the other way round with
other languages where variables have to be declared before they are
used.

View Replies View Related

Aplication Variable Declare

I am calling Server.Execute("2.asp") from "1.asp" and expect to have
application variables declared in "1.asp" available to the script code in
"2.asp", at least this is what the documentations says, but it doesn't work.
I am declaring the variables in "1.asp" as public (VBScript). Does anyone
have an idea if this is supposed to work?

View Replies View Related

Declare A String For Combo Box

how do we declare a string for combo box.I know for a textbox it would be

strName = request.Form("txtName") -provided txtName is the name of the textbox.
Lets say name is the name of the combo box...

Do we declare like this ?

strName = request.Form("Name.selectedIndex") ??

View Replies View Related

Declare String Variable In Asp

I am calling function of vb dll from asp. How do i declare the arguments to be passed of string datatype. I tried using Dim but its giving me error. I want to explicitly declare three variable as string.

View Replies View Related

Update On The Session Tracking/buddylist Thingy

this is dependant on whether or not I can get my sessionID. This is assigned
by the server yes?

so...when I log in, I query what my session ID is, and then store that in a
DB along with a flag that says I'm logged in.

now, along comes someone else who has me in their buddy list, I think I can
query the sessionIDs and remove any records from the DB where the sessionID
no longer exisits. (not sure how yet but I'll work on it).

Then the second user will query the DB to see if I have logged in (and a
sessionID still exists). if so, his buddylist will show me as logged
on...although it could be 20 mins out of date, it's getting closer to the
real thing. Code:

View Replies View Related

Session Variables...

I am using Session variables in my ASP application. I have tested the
application on a Win2k professional and it works fine. When the same web
app is installed on a win2k advanced server from the client browser when the
app is accessed the session variable returns null inspite of a value being
already set. I have checked the IIS enable session state settings. When i
use the server machine as client and access the app as localhost then the
session variable has correct value.

How can this be solved? What other settings if any, need to be changed to
get it work.

View Replies View Related

Session Variables

Do session variables carry over if you've left your site and come back?

My shopping cart uses PayPal/IPN to transact and then enter details of the transaction into my database. All of the data entry takes place after IPN has returned all of the data to my site.

A couple of the fields I need to populate are held in session variables throughout the application. When the customer clicks on the checkout button, and is sent over to PayPal's server to complete the transaction, will the session variables still be available to me upon returning to my site?

View Replies View Related

Session Variables

Is there a way to close a single session variable, once it's been created? I have an application that requires a several session variables to be created once a person enteres a certian section of my site. When they leave the variables are set to nothing, as they are no longer needed. I'd like to just close them out, but I will still need to keep the session open, so Session.Abandon will not work in this case.

View Replies View Related







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