Insert Statement Executing Repeateadly On The Page Refresh

i have a form that action is set to itself, on the same page i m having the insert statement, executed when i submit that form, but when the user refresh that page the query is executed and submit the null values in the table.

<form name=form1 action=form1.asp method=post>
<input type........
<input type.......

<input type=submit value....>
<input type=hidden name='insert' value=1>
</form>

<%
if request.form("insert") = 1 then

Execute the insert query

End If

%>

View Replies


ADVERTISEMENT

Executing A SQL Statement From An Asp Script

how to have multiple sql insert statements in one page. i have tried on my own and if i put more then one statement neither statement will work.

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

Frame Doesn't Refresh Properly When Manually Refresh Page

I have a page with 2 frames. The first one has a link that loads a page in the second frame. This page has a button on it. When the button is hit, the page does some processing and loads another page in the same frame (the second).

I use ASP and response.redirect or javascript in the onclick event of the button to do the redirection. When I refresh the page by clicking the button on the browser (IE), the second frame becomes empty. Please note that the src attribute of the frame is not set.

If I set the src attribute of the second frame to some asp page and then navigate to another page inside the same frame, when I refresh the page, the initial asp page is loaded in the frame regardless of the asp page currently loaded into the frame.

It seems that when you refresh the page, the frames are reinitialized no matter what pages are currently loaded in the frames.

I solved the problem by redirecting to the main page in the top frame, passing some parameters and resetting the src of the frame to the desired asp page. Thus, when the page is refreshed, all the frames are properly refreshed too.

View Replies View Related

Executing ASP Page

I have a file called Audit.asp that I want to execute via command line from a batch file (bulk.bat)How can I do this?

View Replies View Related

Executing Stored Procedure In Asp Page

I have written a stored procedure and I am trying to execute it inside my ASP page. So here is my code. It wont work at all, like when I try and open the page It times outs.

<%
dim sqlrs, rs2
sqlrs = "exec SP_GET_KPI_TABLE_HEADERS"
set rs2 = server.createobject("ADODB.Recordset")
RS2.open SQLrs, CMS, 2, 2
%> Code:

View Replies View Related

File Path Of Currently Executing Script/Page

Is there a way to determine the filepath of an ASP script being executed, like so? First file contains:

<%
For Each x In arrNuggets
Server.Execute "/nuggets/" & x & "/default.asp"
Next
%>

The executed file, default.asp, needs to be able to figure out what it's parent folder name is.

Request.ServerVariables("SCRIPT_NAME") only returns the name of the first initial page loaded, and nothing about the page currently being executed.

View Replies View Related

Executing SQL Stored Proc And Returning XML Through ADO In ASP Page ??

I need to return XML from a SQL Stored Procedure which I will execute through ASP ADO code. Stored Procedure as below:

CREATE PROCEDURE pr_GetJobInfo2
@JobType int,
@CntryID int,
@JobTitle varchar(8000) OUTPUT
AS
SELECT @JobTitle = ltrim(rtrim(JobTitle))
FROM dbo.JOBS
WHERE JobType = @JobType
AND CntryID = @CntryID
FOR XML AUTO
[code]

Now the output parameter (@JobTitle) cannot be assigned to FOR XML, so what must I do ??? My ASP code reads as: ....

View Replies View Related

Function To Stop The Remainder Of The Page From Executing

Is there a function in ASP that can stop the remainder of the page from executing?

View Replies View Related

Prolems Executing Stored Procedure From ASP Page

I am trying to execute the following stored procedure from my asp page The asp page is passing a value "@Year" to the stored procedure ut seems to fall over with a declaration problem. Here is the stored procedure Code:

View Replies View Related

Getting The ID From An Insert Statement

I am using ASP to talk to an SQL database. Most of my tables have a primary key named 'ID'. Is there a way to grab the ID of a record in the same line as the INSERT statement?

View Replies View Related

Insert SQL Statement

how can i write an insert whereby.my attributes in Mainshift table is shiftdate, line, shift & description. ShiftDate and Line is the primary key.so i want to insert the shiftdate, from today's date until around 31st Dec 2008 and line i want to do a select distinct statement where i will extract from execmaster table.

for the shift i want it to be a default "2". for the description all is all "working day"can anyone help on how to write an insert statement on this?

View Replies View Related

Insert Statement

I am using simple insert statement that works fine but it doesn't work when you put " ' ", for example "let us" works not " let's us" because of ' sign....

is there anyway user can add anything?

View Replies View Related

Differentiate Page Requested Versus Page Refresh

I encounter a page reload situation in ASP. It is I need a way to differentiate whether the current page - "Application_Result.asp" got reloaded itself when user click on the browserRefresh button or is requested by the previous page "Application_Form.asp".

I tried using
<%if Request.ServerVariables("REQUEST_METHOD") = "POST" then%>
<!--it is requested from "Application_Form.asp, do something-->
<%else%>
<!--Application_Result.asp refreshed itself(such as user clicks on the
browser Refresh button, do something else-->
<%end if%>

However, in both cases, the IF statement above all evaluated as true. how to differentiate this two different behavior (Page Refresh versus Page requested by another Page) ?

View Replies View Related

Insert Statement From DropDown

I have an asp page which runs an update into our mysql database.
The only problem I have is that a user selects a customer from a
dropdown (this is database fed), and I require the selected item to be
loaded into the db.
All I can get in the database is the first part of
their name upto the first space ?
i.e. if the selected item from the dropdown is A B Knowles, the
database entry is 'A'

cust = request.form("customername")

I have tried adding ' " & cust & " ' for the insert statement

What do I need to do to fix this minor glitch.

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

Performing Insert Statement

I have a asp page that contains link(A href tag) to some other page.When the user clicks on the link ,I want to perform a insert SQL statement and then link it to target page.Is it possible?

View Replies View Related

Insert Statement Problem With ASP

I have been working on this problem for a long time and cannot figure out why i am getting a problem. Code:

View Replies View Related

Building An INSERT Statement In ASP 30

I have an old web app that ues an Access database and ASP 3.0. I need to build an INSERT statement based on the contents of a form. What is the best way to handle blank text boxes that are submitted with the form?

For example, I collect all my name/value pairs that are submitted with the form like this... Code:

View Replies View Related

Insert Statement-check

Can somebody check the insert statement i have written?Ofcourse it is giving error.But what i am trying to accomplish here is i want the records to be inserted and then after the records are inserted ,i want it to be sorted and then displayed onto the page.i modified my insert statement to accomplish the same ,but i am sure its totally wrong.

After performing insert..i want to display records in a ascending order..how do i do that?
here is my isnert statement: Code:

View Replies View Related

Problem With Insert Statement

Been trying this for over 2 hours now, and I can't seem to figure it out. I tried browsing these forums for any clues but can't find a problem quite like mine.

Dim conn, rs
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("database.mdb") & ";"

sql = "INSERT into booking(numid, carNo, workshop, bookDate, bookTime, status) VALUES('"& tempNum &"', '"& carno &"', '"& workShop &"', '"& bookDate &"', '"& bookTime &"', '"& status &"')"

conn.Execute (sql)

I keep getting a "Operation must use an updatable query" error message.

View Replies View Related

Insert Statement Problem

Having a problem with my change password code. It bombs on the INSERT statement.....I get an error stating thier is a syntax error in my insert statement but I can't figure out where. The delete statement works fine and yes all the variables are getting passed. Code:

View Replies View Related

Access Insert Statement

I am used to SQL Server, no Access, but this one thing has to be done in
Access. Can you tell me if this query will work, based on the syntax?

I am trying create a new row on the database, in one table, and the primary
key is an Autonumber called PersonalID. This is on the second page, which
shows after the personal has filled out some info on the first page, then
submitted the form using POST. Database name is Shape, and table is named
Personal. Code:

View Replies View Related

Error On Insert Into Statement

i have this error on the regisration page of the website i'm doing.
Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/Shop/register_process_corp.asp, line 40

SQL = "INSERT INTO
------------------^

Code:

View Replies View Related

INSERT Statement Error

The block of code below shows how I am inserting field values into my dbase table:

strSQLStatement = "INSERT INTO tblArticles
(handid,ArticleDate,sport,articleheader, fpick,articleText) "_
& "SELECT '" & handid & "' As handid, '" _
& ArticleDate & "' As ArticleDate, '" _
& sport & " As sport, " _
& articleheader & "' As articleheader, '" _
& fpick & "' As fpick, '" _
& articleText & "' As articleText;"

Conn.Execute(strSQLStatement)

but I am getting an "Insert statement contains fewer items than the insert list" error , when in fact I am not (both 6 field names).

View Replies View Related

Insert/select Statement

How can i get the autonumber(primary key value) from the specific rows when i just insert it.Example

i just insert the member information.
sql="INSERT IMTO register(user,password,address) VALUES (shujuan,841218,singapore)"

so how can i get the autonumber value for this row after i just create it.

View Replies View Related

Pass PK And FK To Do INSERT Statement

Three tables: Registration, Session, Payment: Joined with 1 to many rel. starting with registration, moving to session and ending with payment.
Form 1: Registration= INSERT INTO statement works fine. Reg table now has fields populated with form data.
Form 2: Session= <<<<<this is where the problem occurs>>>>>
Form 3: <<<<<<problem as well>>>>>>

When i want to do another INSERT INTO statement, I have to know the RegID from the earlier table join(registration). Of course, I can't run either Form 2 or Form 3 without knowing the RegID from the Registration table begin point.

I don't know how to increment the RegID as a foreign key in a joined table over the internet. Using Access over the network it's real easy to pass the foreign keys and the design seems to be more flexible this way, but I need to update tables and present stored data to the user across the internet.

View Replies View Related

Multiple Insert In SQL Statement

i have a problem while running an insert query into SQL using ASP. sometimes the query inserts the values twice.

View Replies View Related

AddNew Or Insert Statement

I want to know the opinion of you all great guys out there whether AddNew method of recordset is better to use & secure than simply a insert statement.

View Replies View Related

Looping Through SQL Insert Statement

I dynamically load a question into a form along with its answer and its name (1,2,3...).
It's name is the the numeric value loaded but I ad on: Code:

View Replies View Related

Refresh Parent Page From Child Page

This is my coding:

window.opener.location.reload(); window.close();

I don't want the IE to pop up the alert msg to false retry or cancel to reload the page.

I have tried:

1. window.opener.location = window.opener.location
2. window.opener.history.go(0)

But as i carry some data from previous previous page, when i use (window.opener.location = window.opener.location), it can't capture my data as it just load the page. It will pop up error as no data captured :

Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: ""]'

Any suggestion?

View Replies View Related

Syntax Error In INSERT INTO Statement.

Now I know I posted this elsewhere twice but no one seems to even be looking at them. I really am stumped by this problem.

I recieve the error:
Microsoft JET Database Engine error '80040e14'

Syntax error in INSERT INTO statement.

/quizmaker/admin/create_teacher.asp, line 20

DIM mySQL
mySQL = "INSERT INTO users(user, password) VALUES('"& uname &"', "& pword &")"
USERS1.open mySQL , objConn <----- Line 20.

View Replies View Related

Syntax Error In INSERT INTO Statement???

Syntax error in INSERT INTO statement.

Please download the attachment and unzip it.

I have 4 files:

Starting with "signup.asp" - fill up the registration form. this will forward you to next form.

"signup_process.asp" - process the filled form
"signup_success.asp" - indicate that register successfully
"Database.mdb" - the database file (MS Access 2000 format)

My problem occurs in "signup_process.asp".
The error message found in IE:

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/myweb/signup_process.asp, line 31

I look through my code, but found no mistake.

But why still I cannot add the information in the form into the "Database.mdb"?

View Replies View Related







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