Database Queries, Seperate Asp Pages?
I want to have a page that has several links on it, each link will do a different search on a database. Now I know how I can achieve this using different pages. (a.asp b.asp c.asp etc etc for example) however i've noticed a lot of webpage that just use one search.asp page and then the id changes for example the address will be search.asp?id=1 for example, hope this makes sense.
View Replies
ADVERTISEMENT
The following statement works fine in SQL Query Analyser: SELECT count(*) as a from NEWUSERS WHERE activated='Y'; SELECT count(*) as b from NEWUSERS WHERE activated='N' -- It returns two values, yet when I have it in a .asp file, it only displays the first value. Is there anyway around this, without making two connections to the DB, and running two seperate queries?
View Replies
View Related
Products ---> Products|Customer <--Customer
With regardst the above many-to-many relationship:
Is there any advantage in creating seperate access databases for:
- Customer
- Products
....Rather than keeping them as three tables in one database.
The reason I ask is that I have found that if I am using a ftp approach to
overwriting or updating the remote database there are sometimes problems
with synchronizing data .....This seems to be a better solution?
Am I off base?
View Replies
View Related
I have a string called EmployeeName. This variable has the first and lastname of the employee.I would like to know if it is possible to extract the lastname into another variable for searching.
View Replies
View Related
If I had a field which is let's say "123 Abc Street" and I would want to seperate the street number from the street name. I formulated this in excel:
=MID(A1,SEARCH(" ",A1,1)+1,LEN(A1)-SEARCH(" ",A1,1))
Where A1 is the cell...
Is the syntax the same in ASP?
Also I want to use this on a field called "Address" in my database, and then sort by the results of this formula. So could I do something like this:
SELECT * FROM Properties_tbl ORDER BY MID(Address,SEARCH(" ",Address,1)+1,LEN(Address)-SEARCH(" ",Address,1))
View Replies
View Related
Did anyone know how to do the seperate? when i search "aaa" keyword from database. and their is 100 result i want to seperate it to dispaly 20 result perpage. like the search engine 1.
View Replies
View Related
I am working on a page which listing all product in one page, by should be in 2 column rather than just one.
PS: I can do show up all products in 1 column by do while not loo,...
can anyone reply with some simple asp code, just the code for seperate the listing in 2 column...
View Replies
View Related
I am trying to Seperate the City and State from one table row to another table row:
Field is name LANDMARK with valeus as Atlanta, GA
Want to get
City = Atlanta
State = GA
into two sperate fields
This is what I have
"STATE = "Right ("LANDMARK",2)"
View Replies
View Related
I am trying to Seperate the City and State from one table row to another table row:
Field is name LANDMARK with valeus as Atlanta, GA
Want to get
City = Atlanta
State = GA
into two sperate fields
This is what I have
"STATE = "Right ("LANDMARK",2)"
View Replies
View Related
I just want to include a function in a seperate file so i can have it on a bunch of pages. What tag should i use?
View Replies
View Related
i am not able to connect the web pages to the database I am using the code as follows:
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "d:/Inetpub/webdata/db1.mdb"
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Table1", conn
%>
View Replies
View Related
I have a dbase containing login details for 21,000 members. I also have a
forum that I am about to implement.
When the user gets to the main site, he has to login (this is done by
checking his credentials against DB1) When he is logged in, all his details
are stored in session variables. Clicking on the forum link will take him to
the forum where he has to log-in or register. Currently, the forum checks
cookies to see if there is a valid name and password and then checks these
against it's own DB (herein called DB2) or requires the user to
login/register
I plan to modify the forum so that the login is bypassed and the forum
accepts the current session name and password as the login. (This is so that
all names on the site main site, chat, forum etc are uniform, i.e Dave47 in
a chat room, is Dave47 in the forum, is Dave47 in the members area etc)
so...what I need to do (if you're still with me) is.
When a new user registers on the main site, his details are put into DB1
*and* DB2. , can I have two data sources open at once?
The reason I need two DBs is that the information in DB1 is a lot less than
is needed by the forum in DB2.
Also how can I copy selected fields from DB1 (name, password for existing
users) into DB2? like I said..there's 21,000 and to do it manually would
take forever.
View Replies
View Related
I have a textarea that displays the values from the recordset. But how can I display each value in a seperate line
While not rsHires.EOF
Response.Write rsHires("Emp_Name") & "
"
rsHires.MoveNext
wend
I tried <br> too, but they get printed into the textarea.
View Replies
View Related
I am working on a CMS website which uses a access database.
When a user adds a page a record is added to a table in the database. The user choses the page style from a selection of 7 or 8 layouts.
I have been asked to find out if I can password protect one of those pages??
I have tried a few sites but not found much. The it has been done before is to add a password protected layout and build a login area into the site.
The effect i want is for the user to click the page and a username and password box will apear?
View Replies
View Related
Normally I use Access database with ASP, and I create queries using the wizard which Access has. Then, I copy and paste the code in the ASP page and create my SQL.
I was wondering if it is easier to call the query directly with its name from Access, or else continue using the old procedure.
View Replies
View Related
I'm trying to build sql queries that will search through my DB. I am currently seperating my queries through multiple indexes in an array depending on whether or not the strings are wrapped in quotations.
I also want
Fluffy
Teddy
Bear
(three different LIKE statements)
View Replies
View Related
I have the following page which I am using to select 3 diffrent queries but i was wondering if i could just use one SQL statement instead of 3? Code:
View Replies
View Related
Say I have 5 fields in a form. I have figured out how to query a database using all 5 fields and display the records that match at least one of the fields.
I'm trying to figure out a way to, if say the user only fills in two fields, to only search the database for matching records based on just the two fields. As I have it now, the database is searched for the two fields they entered as well as three fields of "", which I would rather not have. Is this possible?
View Replies
View Related
I have a DB. With 1 table called "products" and 3 product records. The 2 fields present in the table are called product_name and product_price. The names of the products are Product1, Product2 and Product3. They cost 13, 8 and 24. Which code (SQL and AP) would generate an output similar to this?
Total is: 45.
Product1 costs 13
Product2 costs 8
Product3 costs 24.
<%
SQL = "Select * FROM products" (plus some kind of sum function to calculate the total (to be able to display the sum before the various products) of the recordset without having to loop through the recordset first)
%>
View Replies
View Related
Using IIS 5.0 and sometime some asp pages (absolutely
randomly) showing as blank white pages. So far only one
way of fixing it - restart whole server. Restarting IIS,
or specific web server not helping, only whole server.
I enable server side and client side debugging, but no
errors showing up...
In view source pages always look like this:
-----------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1251"></HEAD>
<BODY></BODY></HTML>
-----------------------
Any idea why it can happened and how to fix?
View Replies
View Related
I need to connect to 2 different databases in ASP and execute two different queries. Please let me know how to proceed. I understand that ADODB.Command option can connect to only one database at a time.
View Replies
View Related
I am running the following code to an access database
' Recordset Object
Dim rs
' connecting to database
con.Open connStr
' executing stored procedure
Set rs = con.Execute ("exec SpotDesc")
' showing all records
While Not rs.EOF
Response.Write rs(0) & " " & rs(1) & "<br>"
rs.MoveNext
Wend
' closing connection and freeing resources
con.Close
Set rs = Nothing
This works and runs the stored procedure SpotDesc.
One question I have is that this line brings back the results
Response.Write rs(0) & " " & rs(1) & "<br>"
but requires me to know how many colums are being returned, ie rs(0) is column 1 and rs(1) is column 2
Is there a way of writing this line and it places all the columns there wheter it be 1, 2, or 3?
Ie a way of know how many columns are returned...
Is there also a way to show the column heading?
View Replies
View Related
I never ever thought about this, but recently I made a query in access so I
can make a customer mailing list based on relational information and it was
so easy to make the query and join tables and assign criterea using access.
And I haven't tried or thought about this cause in my own small asp projects
I've never used a dbase with queries in it, but after seeing how easy it
was, it would save a lot of time from manually writting queries in asp.
So, what I'm asking is if I can use a query from an mdb in asp just like I
can access tables?
View Replies
View Related
This "query2" is used in an MS Access environment.
SELECT T_Perso.*, query1.*
FROM T_Perso LEFT JOIN query1 ON T_Perso.IdPerso = query1.IdPerso;
In SQL, "query1" is :
SELECT T_Items.*, T_Items.IdTypeItem
FROM T_Items
WHERE (((T_Items.IdTypeItem)="Inscription"));
I would like to translate "query2" in full SQL language in order to use it
in ASP but I have some problems with syntax and sub-queries.
I suppose it's quite easy but.I'm a newbie in SQL.
View Replies
View Related
Can I have one recordset execute a Select and then have another recordset execute a different Select, and then check if a field from the first recordset is different from the field in the 2nd recordset and if so write out that row on my displaying table?
View Replies
View Related
I want to define search based on diffrent conditions.The user has the option to select any number of choices.i.e
Condition1.Age
Condituon2.Age & marks
Cindition3.Marks
How do I construct dynamis sql query?
View Replies
View Related
I am using ASP and crystal reports 8.5. I am able to show report from asp. My problem is , I have to show the report based on the sql query that is passed to crystal report from asp. I actually dont know how to pass a query into crystal reports from asp.
View Replies
View Related
I have a single asp page (index.asp) with an include file (include.asp). I would like to query the database with index.asp as well as query it with include.asp.
I searched online, in my "SAMS Teach yourself active server pages 3.0 in 21 days" and it makes no mention of two queries on a single page. Is this even possible?
View Replies
View Related
Is it possible to use an If statement to select a single query from a list of queries from an access db? Something like this:
If Request.Form("Womens") = "Pants" Then
'open the db and run the query called pants
ElseIf Request.Form("Womens") = "Shirts" Then
'open the db and run the query called shirts
'on and on we go, etc.
End if
My gender categories (women, men, etc.) have multiple sub categories (shirts, shoes, skirts, etc.). Does is make sense to use an if statement(assuming it can be done) in this manner? It seems it would make life easier to use one script to perform many tasks, as opposed to one script that does just one task.
View Replies
View Related
the following statement doesn't work, even thoug when I execute SQL_1 and SQL_2 separetlly it works fine.
SQL_1 = "SELECT COUNT(*) AS ACTIVE_LINKS FROM TABLE_LINK WHERE ACTIVE = 1"
SQL_2 = "SELECT COUNT(*) AS UN_LINKS FROM TABLE_LINK WHERE ACTIVE = 0"
SQL = SQL_1 & " UNION " & SQL_2 ...
View Replies
View Related
I know that asp can be used to fire off stored procedures within databases, but I was wondering - does a 'query' in Access mean the same thing as stored procedure? If it does, how could I get asp to fire off that procedure when needed?
View Replies
View Related
I need to take two seperate queries and put them in a single html table, but i want to combine the sets of data 'while selecting them' so i can use the SQL sort by command to arrange the whole table by date..
sorting the two queries independantly then dumping them to the table results in both queries being sorted independantly, ie the most recent entry(by date) of the second set of data ends up in th emiddle of the table.. any ideas?
View Replies
View Related
as with searching through a mdb table, is it possible to search a query in access?something like...
select * from 'access query' where
View Replies
View Related