Easy ASP Query
Using ASP & Access. So I am having a total brain-fade. I am trying to pull up data out of a table. But I want a "select all" option. What should the value be for the "select all" option of the form? What should the WHERE statement be in the query?
View Replies
ADVERTISEMENT
I need to do a string comparison (in asp) that checks to see if "META" is contained somewhere/anywhere in the string. Can anyone tell me the syntax for doing this?
View Replies
View Related
<% Response.Write "" & FormatDateTime(now,2) & "" %>
Gives me the date in MM/DD/YYYY. How can I reformat this to DD/MM/YYYY?
View Replies
View Related
I'm hoping for an easy solution to this that I'm not seeing that
someone more experienced will.
All I want to do it mark an option tag as selected....
<%
hourCounter = 1
Do WHILE hourCounter <= 12 %>
<option value="<%=hourCounter%>" <%If hourCounter =
hour(rsCalendarEdit("fld_calendar_DateTime")) Then Response.write "
selected" End If %>><%=hourCounter%></option>
<% hourCounter = hourCounter + 1
Loop
%>
The trouble is if the time is "PM" I have a problem as you can see. Is
there a method or property here I can implement that I'm not seeing?
View Replies
View Related
why asp is retarded compared to some other server side scripting languages? or am i just the retard? Code:
<% If Session("auth") = "1" And Session("userid") <> "" Then %>
// Show user information box....
<% Else %>
// Show login form....
<% End If %>
in my head, what i just wrote should equal something like if the session variable "auth" equals 1 and the session variable "userid" does not equal nothing, then do this.well, i haven't set any session variables, and it's processing the chunk of code right after the above if/then. either shows a user information box or a login form.it shows the user information box, instead of the form.
really baffles me considering i haven't set any session variables. i guess this is why i like php better, but i'm trying to get a grasp on asp, it just seems to hard to do something simple. can anyone tell me why that code is returning the wrong block of code?
View Replies
View Related
<%= objrs ("age"), 2)%>????
how do i get it to only display the first 2 numbers?
View Replies
View Related
I am having trouble with our server host they are saying that the php
upload limit is 20 mbs but using the code below with my flash file I
can only get it to do 8mbs. I know that asp is allowing for up to
20mbs though so I was hoping that someone would be able to change this
code to ASP(I am not very good at either php or asp). I think that
should be pretty easy:
<?php
if (is_uploaded_file($_FILES['Filedata']['tmp_name'])) {
$uploadDirectory = "uploads/";
$uploadFile = $uploadDirectory .
basename($_FILES['Filedata']['name']);
copy($_FILES['Filedata']['tmp_name'], $uploadFile);
}
?>
View Replies
View Related
I am just trying to take pieces out of the sql statement individually and display them. I get this error:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal
There is data there in the table and I'm not sure what's going on. Code:
View Replies
View Related
Im making an asp website for a rotary club what would be the best script to create a website something like a CMS without all the forums and stuff.
View Replies
View Related
What is the easiest way to create a graph in either asp or html code? Is there one? I am doing several SQL queries the result of which I will give me a number. I need to put this number into some kind of graph (bar graph) on the page. THe number will vary so it must be some type of dynamicly created graph.
I would prefer to not use a thrid party tool to do this if possible ......
View Replies
View Related
I'm working on a system that requires alot of date handling, and i'm getting pretty tired of doing custom calculating when modifying dates, so i hope someone would be able to help me. Is there any easy way to do re-calculating of dates? such as adding 2,11
or 36 months to a date, and have it automatically checking whether or not it should increase months or year, and by how much?
Like, if i have to add 11 months to the date right now, i have to check which month it's in to see whether or not i could just take one month lesser the next year and so on.
View Replies
View Related
Basicly I have a table that gets contact info and stores it from a form AND emails me...
Problem is I want to just email a link to the ContactInfo.. which should be referenced via the unique PK so whwn i view it, it would be nice to reference the row just inserted...
ala view.asp?emailpk=141
figured there woudl be something like recaffected out there.
View Replies
View Related
I need to write an application which should work as web application (ASP.NET) and it should have its counterpart for winforms - (they would do the same thing). My question is... what kind of pattern shall I use (MVP or MVC) for writing these apps to minimize overhead of rewriting code (e.g. I'll start writing winform app and then create similar web app )?
View Replies
View Related
I've searched the forum for the answer to this..it's probably on here somewhere but in a different guise to my particular question and I don't know enough to figure it out.
If I have a basic form to mail ie
strEmail = request.form("Email")
and
mail = "me@me.com"
can I simply do this to get my form to be sent to 2 email addresses?
mail = "me@me.com, you@me.com"
View Replies
View Related
I have a "tell a friend" form and the backend sends the information just fine, however in the bodytext I want the "comments" box text to be added to the e-mail. User fills in his name, his email, friends email, comments box (name=message) and the email is sent except the text from the comments box. My code for the body tag is:
objNewMail.Body = sendersName & " (mailto:" & sendersEmail & ") thought you would be interested in this article " & vbcrlf & vbcrlf & vbcrlf & "Link:" & vbcrlf & request.ServerVariables("HTTP_REFERER")
How can I insert the comments box text in there?
My thought was:
objNewMail.Body = sendersName & " (mailto:" & sendersEmail & ") thought you would be interested in this article " & vbcrlf & vbcrlf & message & "Link:" & vbcrlf & request.ServerVariables("HTTP_REFERER") but it does not work.
View Replies
View Related
I have several pages ( ASP) that were working OK on NT4. We moved it to Server 2003. At random , it appears that the Server.CreateObject fails.
I've looked through the code and it looks OK. Is there an easy way to make sure I have Closed all CONNECTIONS RecordSets etc.
View Replies
View Related
The database is used for referencing filename, there located folder, id, order shown, but also there are some fields say "location_1" up to "location_4" which have a 0 , 1 or 2 in them. 0 means that file not needed for that section. 1 means needed for that section, and 2 means mandantory (must be seen before exit).
firstly selecting a location from a html radio box, drop down menu (not decided yet) will return whats needed so not showing pages what aint needed and wasting time.
Here it is though in order on the left i wish it to build a menu, but more advanced than plain links would be good. drop down like windows explorer etc. Code:
View Replies
View Related
i would like to create the following one, but nor I know as. One index.asp that db catches one information as heading, hour of entrance and station time and shows in the page index. An example, let us assume that now they are 23:00, then the shown information will be inserted in the page index.asp in accordance with the current hour.
If it will have something registered in cadastre in db that it starts the 23:00 and it finishes the 01:00 will be in index, passing the hour it leaves and it enters another message with programmed hour.
If I have in db a message that would have to be shown of the 09:00 the 11:30, and now I am 11:20, the system analyze and show the information, until he is 11:31, when then I enter another one, and thus successively, they are menmsagens that in accordance with enter the hour of the server.
View Replies
View Related
I have a variable that represents a standard mm/dd/yyyy date , but i want to change it to just October 6
''''
datepart("m","d" , mydatevariable)
'''''
....doesnt work.
View Replies
View Related
i'm looking for a easy to setup web chat script that i can install on IIS? if someone can point me in the right direction it woudl be great, i download a couple cgi scripts but couldn't get them to load.
View Replies
View Related
I have several pages ( ASP) that were working OK on NT4.
We moved it to Server 2003. At random , it appears that the
Server.CreateObject fails.
I've looked through the code and it looks OK.
Is there an easy way to make sure I have Closed all
CONNECTIONS
RecordSets
etc.
View Replies
View Related
I am adding simple records to a fairly simple access database with the following code
rsEntry.Fields("Player1") = ShortName(Player1)
rsEntry.Fields("Player2") = ShortName(Player2)
'Write the updated recordset to the database
rsEntry.Update
rsEntry.Close
adoCon.Close
Set rsEntry = Nothing
Set adoCon = Nothing
How can I SIMPLY :-) prevent duplicate records from being added? I know I can set the index property on the fields but that mean handling the errors - not sure how to do this.
OR I could write the code to seach the DB before update - which may be the only way :-(
Is there a simple way?
View Replies
View Related
My code retrieves a username and a password from a form. Then this information is compared to some usernames and passwords that are stored in a database. The important thing here is that the comparison must be case sensitive meaning that "passWord" is not the same thing as "password"
I have this code, working fine in access 2003
SQL = "SELECT * FROM users WHERE StrComp(username_column,'" & entered_username_in_form & "',0) = 0 AND StrComp(password_column,'" & entered_password_in_form & "',0) = 0"
but get the following error when I run it against my sql 2005 database.
[Microsoft][SQL Native Client][SQL Server]'StrComp' is not a recognized built-in function name.
I don't know the corresponding t-sql for the query.
View Replies
View Related
I am running a querry on an access database and have set the number of records/page displayed at 20. if there are more than 20 records returned, then 1st page will show the first 20, the next page will show next 20 and so on....
The trouble:
the count of total records displayed is correct and the first page is displayed correctly. But when i click on *Next* to go to the next page, all the records of the database get displayed (not the 2nd page of records from the query).
View Replies
View Related
I am using ASP/MS ACCESS to see how I can query the same database, via 2 formfields.
{name: - search}Textfield 1: - Search by Category
AND/OR By
{name: - searchT}Textfield 2: - Location
Currently,
strSearchwords = Trim(Request.QueryString("search")); where "search" is the name of Textfield1
Which is fine, but how can I set it so that on Submit, the string from search, and searchT are somehow joined together into one string?
View Replies
View Related
In Access you use "*" + [passed variable] + "*", + can be replaced with &
Calling a parameterized query in Access requires % be used in place of *,
however, all that I have read show dynamic SQL passed to Access:
WHERE [some column] LIKE '" & ASPvar & "' % ORDER BY ...
However, my call is similar to:
conn.qMyLookup strVar, rs
If I modify the query in Access to:
"%" & [passed variable] & "%"
I get all records. If I only put it at the end, as suggested, I only get
matches at the end, not throughout the column. Code:
View Replies
View Related
Is it possible to write sql query to fetch records from
specific record number?
lets say i have one variable and it stores values such as
1,2,3 or so...
if variable contains, i want to fetch records from 1 to
20.
if it contains 2, then records should be from 21 to 40.
for 3, records would be 41 to 60...
what could be the sql for that?
i dont wannna fetch whole table and then filtering
through code..
View Replies
View Related
i have a table called checkrenewal
it has a field called date_renewal
data is stored like this
03/20/2007
05/17/2008
10/21/2006
09/18/2006
09/04/2006
so what i want to do is display only records that are in month of sept for 2006
so there will be 2 records
so next month is Oct 2006 so only display one record
so depending on which month and which year it is display only those records.
View Replies
View Related
I can't write the sum of a certain colum in a table of a db.
<%
sql_Sum_Tax="SELECT SUM(vtax) AS sql_Sum_Tax_RS_Var FROM orderstats
WHERE vcompletedate BETWEEN "& startDate &" AND "& endDate & ";"
Set sql_Sum_Tax_RS = Server.CreateObject("ADODB.Recordset")
sql_Sum_Tax_RS.Open sql_Sum_Tax, conn1
%>
<%=sql_Orders_Placed_RS("sql_Orders_Placed_RS_Var")%>
That last line generates this error:
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
View Replies
View Related
i have a table and the fields are
gender
weight
points
the records for example are
Male 55 2.0
Male 60 3.12
Male 65 3.87
Male 70 3.99
so i need to find out the points when the user selects gender and enters the weight
people are allowed to enter weights between 55 and 70
say for example someone enters weight as 55 his points will be 2.0
if someone enters weight as 64 i want the points to be 3.12
View Replies
View Related
I have an Access database of literature that I want to search using an ASP page using multiple search criteria (author, title, year, discipline,etc).
I'm using a form to collect the criteria from the user and then sending it to an ASP page. I'm creating the SQL statement using variables that pick up values passed from the form.
Code:
strSQL = "SELECT * FROM Literature WHERE " & _
"(Author Like '%" & mauthor & "%') AND " & _
"(Title Like '%" & mtitle & "%') AND " & _
"(Journal Like '%" & mjournal & "%') AND "& _
"(ArticleBook Like '%" & mBookOption & "%') AND " & _
"(Year Like '%" & myear & "%') " & _
"ORDER BY Title ASC;"
This would probably work if I used "OR" in my SQL, but I want to be able to use "AND." My problem is that I'm not getting records that have null values in some of these fields.
View Replies
View Related
Ive been working with queries through asp on a mdb file. The biggest problem i have is
that when i query a certian column that had embedded hyperlinks in it, the query also
returns the value of the hyperlink. Is there any way not to have to remove the hyperlinks
in the database and not have them show up on queries? Code:
View Replies
View Related
I am learning ASP from the Wrox Begining E-Commerce book, which uses Visual Basic to create a DLL and it also uses MTS as well.
I have been trying to find hosting not realising the problem with registering custom dll's on server and know realise that this isn't the best way to do this.
I wanted to know if there was anything i could do to change this. I have read a little bit about the Global.isa file but am not sure about this.
Could i just transfer all the code into the global.isa and then use it like this.
My website access a sql database and uses a mts pipeline for order processing.
I don't have enough experience of ASP to re-write this code and am not sure of what to do.
I have tried searching the web but am not really finding any solutions that I understand.
View Replies
View Related