Inserting 2 Different ASP Statements Into One ASP File

I have two ASP statements (<% , %>) that I would like to insert into one ASP file. One of the statements is already inserted in the file and works successfully.
However, when I insert the second ASP statement, the page comes up with an error;-

"Microsoft VBScript compilation error '800a0411'

Name redefined "

I am pretty sure I get this error because both statements are conflicting with one another.
I also can't combine the two statements as I use a DSN connection for one, and a DSN-less connection for another and I connect to 2 different databases.

How might I be able to include both ASP statements within the single ASP file?

A user on another Forum said " there is a variable DIMmed twice.

easiest way is a third include with the variable names in. That way it can be used with any combination of the includes."

View Replies


ADVERTISEMENT

Multiple Possible Include File Statements

For some reason, I am having trouble with this. I want to have a select statement, such as -

<%
Select Case Request("service")
Case "s"
<!-- #include file="includes/bottom_nav.inc" -->
Case "p"
<!-- #include file="includes/bottom_nav.inc" -->
Case "a"
<!-- #include file="includes/bottom_nav.inc" -->
End Select
%>

I know that is not the correct syntax for the include files.

View Replies View Related

Inserting Date In Csv File

I am trying to insert the date into a *.csv file using the following line

csvBody = csvBody & "" & fix(FormatDateTime(now(), vblongdate) & ""

The fix function is as follows

function fix(strInput)

strInput = replace(strInput, """", "")
strInput = replace(strInput, vbNewLine, " ")

fix = strInput
end function

I would like the Date to appear as Wednesday 16th June 2005 within a single cell (without commas).

View Replies View Related

Inserting Into Oracle Using A Csv File

I have to read from a csv file (; delimited) and insert it into an oracle table using asp. the file can be anywhere in the local. so is it possible to use a form and get the file name or the location as an argument. Also how do i do the insert in the existing table. Code:

View Replies View Related

Inserting Signature Bitmap File In An Asp

I am trying to build a asp page where signature bitmap file needs to be
inserted from a directory. The path of the file location is in one of the
backend Access database fields. I would like to know if there is any
knowledge based article related to this kind of issues. I have no idea where
to start on this.

View Replies View Related

How To Get Data From An Excel File And Inserting Them Into A Database Using Asp?

I would like to know if there are any tutorials out there or websites that can explain more about this? can this be done in asp?

View Replies View Related

Validating An Uploaded File Before Inserting Data In To Database

I am uploading a file using ASP code. After the user uploads the file, I would like to be able to open the file and check if the data is in a given format (comma separated) and also has all the data elements needed (i.e. all fields are there).

Is there a parse routine in asp that would allow me to do this. The user can upload any type of file as long as I am able to parse it and determine if the data is of the aforemention type.

View Replies View Related

Carriage Return Before Inserting Text Into Acess Database File. How To Do It?

how to replace carriage return upon extracting text from Access file.

However I think it will be smarter to do it before (during) inserting text into acess file.

It might be primitive question, but I started my ASP learning just last week and many things are confusing me on this stage.

QUESTION:

What should I change in my ASP file code (file inserted data from the HTML form file into database file) to replace all carriage returns and line brakes during inserting text into field GuestSory? Code:

View Replies View Related

Asp If Statements

I need some help with some if statements in an asp page I got. My sql statement is:

sql = "select * from courseDesc"

I want to logically diplay all the information on the page. So I inserted this if statement to choose the information I want to dispaly:

<% if rs("courseName") = "whatIsCist" then
response.write(rs("description"))
end if %>

Other courseName titles I need to display the information for further down the page, include: wdt, lan, wan, programming, admissionReq1,2,&3. Does anyone see where my problem is?

View Replies View Related

IF Statements

I'm having problems getting some ASP code to work with a form I'm using. I'm using the script with a multiple page form and want to print a javascript onsubmit value for just one of the forms. I'm getting errors because of the multiple IF statements and I'm not sure how to do this and have the "s show up properly in the output. Can someone tell me how to do this properly?

Code:
<% If step < 5 Then Response.Write " <form action="/script.asp" method="post" name="theForm" id="theForm" & If step < 1 Then Response.Write " onsubmit=""" & "return checkForm(this);" & End If %> & ">" & End If %>
Here is how I want it to output:

<form action="/script.asp" method="post" name="theForm" id="theForm" onsubmit="return checkForm(this);">

View Replies View Related

Use Or And Statements

is there a way to use "or, and" statements in asp,
what i want to do it do 2 seperate checks on the database and if one is true or the other one is true then display some text is this possible and also the same check again on the database but the first statement and the second statement has to be true then display some text is this possible, if yes how would i do it?

View Replies View Related

If Then Statements

I have a field on an asp form called hotelYesNo (YesNo value-pulldown) and a field called roomMate.

I want to do an If Then statement likeso: If hotelYesNo = Yes Then roomMate is required, but if hotelYesNo = No Then roomMate is not required.

I don't know how to get this accomplished in the asp code.

I know how to do this in Microsoft Access but not on a webpage.

How would this be done?

View Replies View Related

If Then Statements

I want to run a query and need to use If then statements such as: If this is output, then run this query. Is there a way to do this?

View Replies View Related

If Statements

I didn't really get a direct answer in the .net forum so I guess I'll just post it here where it should be anyway. Instead of .net I'm just going to probaly stick with 3.0. I want to have several different templates for users to browse a site in.

Since I can't use include files in ASP is there a way I can ONLY load coding in an if statement as it applys to that certain user? I want to enclose multiple images and coding into one file but only load the ONE image/code that pertains to the user. Is this possible using if statements?

View Replies View Related

IF Statements

i am trying to find out if three feilds in a record match, if so send it to another page. basically see code.

Quote: rs.Open "Rental", cs, adOpenDynamic
Do Until rs.EOF
If rs.Fields("MemberID").Value=person And rs.Fields("DVDID").Value=dvd And rs.Fields("Current").Value=true then
Response.redirect "copy.asp?memberid=" & person
End If
rs.MoveNext
Loop

this does not bring up a problem just does not do it any ideas on if staemenst etc in asp thingy.

View Replies View Related

ASP And SQL Statements

I have a (hopefully) simple question that has been giving me some problems. I'm trying to use a simple Select statement to access some data in an access database. In access, the sql statement is as follows:

SELECT TPL_Checklist_Master.[1] From TPL_Checklist_Master

However, when I try to do this on an ASP Page, it always causes an error. I'm assuming this is because of the [] around the field name 1. (I would change the field names, but I don't have control over that).

I know when trying to use a * in the statement Where field LIKE 'A*' I needed to replace the * with a %. I was wondering if something similar had to be done in this case.
I hope my description is clear enought to follow.

View Replies View Related

Asp If Statements

We have currently launched a website in ASP and now want to add some tracking functions.
We have banner ads and emails that we are launching.I would like to create code that will allow me to change the an image and a text link based on where the user is linking in from.

I.e If they clicked on banner xy - then the index page the images would be xy and the text box in another page would be xy. if they clicked on banner zz - then the index page the images would be zz and the text box in another page would be zz.

View Replies View Related

Include Statements

I have been avoiding this issue but it keeps popping up and I cannot figure out a solution. Include statements pathed two or more folders deep they break.

This works:
<!--#include file="../includes/mo_security.asp" -->

This does not work:
<!--#include file="../../includes/mo_security.asp" -->

So basically my site files are limited to one folder deep.
Ex: ROOT/parentFolder/files.htm
One I move another level down the includes do not work anymore:
Ex: ROOT/parentFolder/childFolder/files.htm
I am on a Windows IIS server. Is there any solution to this or is it just a limitation of the include statement?

View Replies View Related

Converting Sql Statements

I have a project to do that requires that I use mysql as the database. I have only used MS Access. The sql will be simple searches.
Is there a drastic difference, or just different punctuation?
Can I find a copy of mysql on the web? If so, is there any advice on installing?

View Replies View Related

VBScript If Statements

Is it possible to wirte a VBScript If statment that outputs different HTML? IE: If **** = True then do this HTML else do this HTML?
How do you do something like that?

View Replies View Related

LIKE Operator For IF Statements?

Basicly I pull the whole column contents and what to test to see if the username is that list. How can I do this in an if statement. I know how to do this kind of thing in SQL (LIKE operator) but I need to test agains two recordsets. Code:

View Replies View Related

ASP With SQL Insert Statements

Question 1: How can have th asp script automatically convert the date generated by the system to a format which is acceptable by Sybase SQL (yyyymmdd)

Question 2: If the user were to insert a a string containing " ' ", how can I convert it into a special character so that it won't be treated by Sybase SQL as the start/end of a variable?

View Replies View Related

<!--#include--> Statements

I am using the ASP include statements for some HTML code, and I have the <body></body> tags included in an outside <!--#include--> file. Is this OK? Or could it mess something up not having the <body></body> tags in the actual page HTML?

View Replies View Related

Sql Update Statements

I am getting an error on my sql update statement and I can't find where it is. I am getting the message, "syntax error in update statement". when I do a response.write on my sql statement this is what I get back

update tblUser set lastname='Ray', firstname='David', address='petal ms', email='david@ray.com', pass='dray', where username='dray'

View Replies View Related

Using If Then Statements In Href Tag

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.

View Replies View Related

Combine Two Statements

I'd like to combine if possible these two statements drawing from a total of 3 tables.

sql = "SELECT p.Sub_ID, p.Cat_ID, p.Sub_Name, COUNT(c.Sub_ID) as ct FROM
Subs p LEFT JOIN Links c ON p.Sub_Id = c.Sub_Id GROUP BY p.Sub_ID, p.Cat_ID,
p.Sub_Name ORDER BY p.Sub_Name"

sql = "select * from Subs inner join Cats on Cats.Cat_ID=Subs.Cat_ID ORDER
BY Sub_Name"

Is it possible? Am I totaly screwed up for even trying? The goal is to count the relations ships in the Subs and Links table based on Sub_ID, to display needed data from the Subs table, and to display the Cat_name table from the Cats table in relationship to the Cat_ID in both the Cats and Subs Table.

View Replies View Related

Prepared Statements

I am trying to create a prepared statement in ASP, but am having problems with creating the parameter object. I do the following

Set fnParam = peopleUpdate.CreateParameter("@firstname", adVarChar,
adParamInput, 50, peopleSourceRS("firstname"))

But this gives the following error on the browser:

Error Type:
ADODB.Command (0x800A0BB9)

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. The server doesn't seem to like adVarChar and adParamInput. I did try
to create the parameter without arguments and then assign the properties, but it gives the same error for .Type and .Direction. What am I doing incorrectly here?

View Replies View Related

Joining Two SQL Statements

I have these two statements and I want to join them to make one query, i don't know how to do it since there are two querystrings that are selecting my data for me.

sSQL = "SELECT * FROM AssemblyName Where AssemblyName = '" & Request.QueryString("assembly") & "'"
Set oRS = oConn.Execute(sSQL)

sSQL = "SELECT * FROM PartsList Where ID = '" & Request.QueryString("one") & "'"
Set oRS2 = oConn.Execute(sSQL)

View Replies View Related

If Statements And Wildcards

if not request("email") like "%@%" or not request("email2") like "%@%" then
response.write "<span class=""whitebox500""><br>THIS DOES NOT APPEAR TO BE A PROPER EMAIL ADDRESS."

response.write "<br><br><Br><input type=button onClick=""javascript:history.back(-1);"" value=""Back to Signup <<""><br><br>"
response.end
end if

and want to wildcard test the request to see if it is properly formatted email with an @ and a dot.

View Replies View Related

Two Insert Statements

Can i have 2 insert statements in my code inserting data in different tables.

So after i hit submit,the date should go and reside in particular tables.is it possilble?>and if yes..how do i do..any examples /links you can pass me?

View Replies View Related

Conditional Sql Statements

I have a shopping cart that I want to load items in that come from a huge scrolling form. In other words, when someone clicks on a category in our site, it scrolls out all the items in that category, maybe 30 or more. I have text boxes next to each item so somone can enter a number, then press submit form button at the bottom of the form, and
send those slections to the shopping cart.

The problem is, many of the text boxes are empty, yet they are still being sent to the shopping cart as a quatity of 0. Is there a way for sql to ignore a value if the variable is zero, or only get the sql statement to run if a variable is > 0?

View Replies View Related

IF Statements To Update Database

I need help with fixing my code below. It doesn;t work correctly. It works fine when there are 4 featured records. But I want to be able to change one to not be featured (equal to 0). This is not possible with my current code. It shows the same message about me not being able to have more than 4 featured records. Can someone please help me with this?

Code: ....

View Replies View Related

If Statements And Subs Problem With End IF

I am trying to get a page that loads up a different include file depending on which input form button was clicked.

I can get it to work with just one if statement but once I put a second if statement in I get the following error

Quote: Error Type:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
/ordersearch/ordersearchresults.asp, line 27

Now no matter where I have though of putting my end if the page now doesn�t work. Does anyone know of the solution??? Code:

View Replies View Related







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