2 Simple Queries Into One
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 Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Simple Encryption (simple)
A system I use uses advanced encryption for passwords. It was taken from some sample script and adapted some where. However this was I think intended to be for passwords. So nothing too long. However the time has come where I need to create a function to encrypt a large amount of text. It has to encrpt a large amount of text but nothing too advanced is needed to be honest. Just so its unreadable because its written to a text file on drive. It has to be a function though then capable of decrypting the encrypted text. Any ideas ? Again Dont have to be nothing too flash. I mean I had a go at just changing letters to different letters but the function got huge with all the replaces.
Queries
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.
SQL Queries
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)
3 Queries Or 1
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:
On The Fly Queries?
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?
Multiple Queries
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.
Stored Queries
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?
Can ASP Use Access Queries?
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?
Sql Problem With Sub Queries
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.
2 Queries And Then Compare Them?
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?
Dynamic SQL Queries
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?
Passing Queries
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.
Two Separate Queries
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?
Many Queries From An If Statement
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.
Using ASP To Run Queries In Access
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?
Combining Two Sql Queries
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?
Searching Queries
as with searching through a mdb table, is it possible to search a query in access?something like... select * from 'access query' where
SQL Queries And Placing Them On Form
basically, I have the files for this thing, it basically retrieves and displays records from SQL on screen. cool. Now I want to add further additional fields in that asp file, so ive added labels and textboxes. cool. How do I tell it to go to the SQL DB and retrieve the data? Once its done that, how do i take each field that is required and place them in the correct textboxes?
How To Verify A User Using Sql Queries
I have a form which accepts the username and password. I am storing it in an Access Database. How do I check if the user already exists in the database by passing SQL queries? Could someone possibly give me the code or maybe a link.
Message For Long Queries
give me a sample code to display a "please wait" message while retrieving results from the database in ASP.
Text Files Queries
i have a text file (tsv) with products in, but i want to run queries on certain fields, e.g. description, i ahve tried linking the txt file to a databse but the recordset does not work, does anybody have a sample script that will query a tsv, csv file.. e.g. SELECT FROM prices.tsv WHERE products = cisco
Dynamic Dates In Queries
I have a form submitting a date range in ASP. I want to use them in a query to select from access.I've done similar things with other languages and/or other DBs. StartOfMonth = Request.QueryString("StartOfMonth") StartOfNextMonth = dateAdd("m",1,StartOfMonth) EndOfMonth = dateAdd("d",-1,StartOfNextMonth) StartOfMonth = CDATE(StartOfMonth) EndOfMonth = CDATE(EndOfMonth) sqltext = "SELECT * FROM NewsLetterRequests WHERE CDATE(DateTime) >= " & StartOfMonth & " AND CDATE(DateTime) <= " & EndOfMonth
Modifying Sql Queries On The Fly With Variables
I currently have a sql query that pulls all records based on a variable(var1) inputed by a user from a form. Each record in my database has a time stamp assoicated with it. I want to give the user the option of pulling all records based on (var1) and allow them to sort based on date or time stamp also with a two fields that will take a range. (ex. Beginning date and Ending date). So my default sql query will allow for var1 to be inserted and to have all records returned for the current day. BUT, IF A USER HAS ENTERED A DATE RANGE then all records will be returned for that date range based on the var1's value. How could i go about about structuring my code for this? I was thinking about a "Switch" statement that could response to different user options with different sql queries. What do you guys think?
Problems With Redirection And Sql Queries...
i have been doing this asp page....but the page doesnt seem to work....it doesnt redirect as i wanted it to be...i dont get any erro message....so idont know wats wrong witht his code:
Converting Access Queries
We have an Access data base with severl tables, queries and forms.We want to put it on the web.Is there a tool that will convert the Access queries and forms to ASP?Sorta like "splitting" the database... but instead of an Access FrontEnd... have an ASP front end?
Case Sensitive Queries
any way of searching a database without case sensitivity? Make any sense?! I have an Access 2000 db with 11 fields in it: Name, Keywords..., Description... But whenever I try to search through it using the ASp site I made, it'll only find matches if they are written identically, I.E a search for "bob" won't find the entry "Bob". I thought about making the entire contents of the db Uppercase, but I don't want to, as that would look crap when the contents are displayed in the website.
Command Line Queries
I am running a dynamic site using MySQL and ASP and wish to back up my MySQL DB on a daily or weekly basis to a remote server/MySQL DB. I know how to do this from the command line using MySQL: mysqldump -u username -p password --databases myDatabase | mysql -u username -p password -h remote.server.com But i need to be able to issue this command from within an ASP page. PHP has various methods for executing command line queries such as exec() & shell_exec() but I don't know any using ASP.
Multi Queries Done In ASP Pages
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?
Multiple Queries And Using Their Values
I am running two queries on a single page and they essentially work, the only problem is that i am unsure exactly how to get one aspect to function properly. To explain it correctly it will probably be easier to just show you the code, the first query looks like this: Code:
How To Use Form Elements Value For SQL Queries?
Here is my input box which has the employee id. <input type=hidden name=empid value=40578> In my SQL query, I would like to call the value of "empid" textbox in my SQL Query. How can I do this? Code:
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.
Adding SQL Server Transactional Queries To An Old ASP App
I wrote an app several years ago that has only just begun intermittently failing on a particular stage in a series of sql queries. When I wrote it I wasn't familiar with transactions and so didn't bother implimenting them. Since then I've moved from ASP to PHP and have done several applications that used the ADOdb library's transactional features. Now going back to ASP I'm having a hard time finding any information on how to actually impliment a transaction from an ASP page for a set of queries that are not part of any stored procedures. For instance, how am I to know when an error occurs and that I need to roll back? Do I need to set OnErrorGoTo = 0, then check for an error at the end of the sequence and roll back if one occurred? If anyone could post a small example of ASP code that includes a few queries executed with an adodb connection object, wrapped in a SQL transaction, that would be most beneficial.
Select Queries With Just A Text Link
I have 2 queries on one asp page, usually I only run query 1 as default, But I hope there is a text link called "Run query 2" and when I click it, my asp file will run query 2.
Running/Calling Access Queries From ASP
I have an access DB that has some queries built in to it. Rather than putting the SQL in to my ASP Code (which I normally do) I was hoping there is some way to run the queries which already exist in the queries portion of the access DB. The queries do require me to input a variable though. For example, there is one query called qry_FillForm which required me to pass a value called FormID (number) If I have the value for FormID in my asp code, is there a way I can simply get this query to run? I can always create a strSQL string and do it that way, I was just wanting to learn if it is even possible simply call the query that is alreay in the DB without having to manually put the SQL into my asp code.
Running Access Stored Queries With Parameters
I'd like to transfer al my hard coded sql queries to access stored queries and use them with parameters. Actually, I did not find any strong information how to do that. Please, provide me official information, or give me at least one example of using it(with Select statement or other).
Multiple Queries On Single Connection (classic ASP And ADO)
I'm building a page to display a series of records but wanted to filter the results by location and display the resulting records under their own sub-heading. All the records are in the one db table and there'll be a total of 5 queries. I'm unsure whether I need to open and close the connection for each query, or whether it's better to open one connection, run all the queries and then close the connection at the end, if so, the resulting code would look like: Code:
Dependent Queries In Access And Entry Date
I have a created a cost reporting system which shows a level-breakdown report. There are three levels in the report the lowest level holds the cost items that are entered by the user these records also have an Entry Date. The level above that is a Sum of the lowest level and the top level is the Sum of the second level. I created the solution using three queries in Access. I then use the queries in ASP to generate the report. But now I need to use the Entry Date at the lowest level to re-generate the report with values from the StartDate to the EntryDate (which is entered by the user). Question is, can I do this using the construction I use, or do I have to pull my queries to the ASP code and include the dynamic EntryDate? How do I solve this?
Passing Queries To A Crystal Report At Runtime
Im trying to pass a SQL query at runtime to a crystal report (SQLQueryString) but when report is displayed i shows all records of the SQL query saved in design time and not the latest ones retrieved from the SQL query that is sent to the report. What can i do for show the latest records and no the records saved on the report? Does anybody knows why this is happening???
My ASP-access Site Suddenly Very Slow To Respond With Queries
I have an application, which simply consists of an Access database being queried by ASP code in a website, running on a Dell PowerEdge 1650 rack mount server (Pentium III 1.4 GHz) with 1024 MB ram. The server runs Windows 2000 5.00.2195 with Service Pack 4. The application presents HTML tables to users, based on queries made by the user on the website. Problem is: recently the construction of these tables has been very slow and the scripts time-out. The script timeout is set to about 3 minutes. The application has been running for 2 years without any problems, well one. About 6 months ago the same thing was happening. I compacted and repaired the database - did not fix it. However on restarting the server it was back to normal, producing the tables immediately. Now that the same problem is occuring again, neither a restart or a shutdown-restart fix the problem. The straight HTML part is served immediately, but it is evident that it chokes on the tables. There are two other applications on the same server written in the same style, but much more simple. They are working fine. Code:
Simple One
i have 3 fields like these membershipamount=100.00 Postage=15.00 GiftArticles_Amount=5.00 and i add them up to get the totalcharge like this Total_charge=Int(membershipamount) + int(Postage) + int(GiftArticles_Amount) so i get Total_charge=120.00 which is what i want but when i have like this membershipamount=100.00 Postage=15.00 GiftArticles_Amount=3.50 i get Total_charge=118.00
Simple One
does someone know a good site for asp 3.0 interiew questions
Simple If
I have only begun to look into ASP due to an assignments requirements.I usually code in PHP,one feature in PHP is to be able to do an if.else statement,where if a certain statement is true then a chunk of HTML can be outputted. Basically I want to be able to do this in ASP to use with a simple authentication system which I will construct.I have just got a fat book on ASP,and am beginning to read through it
Simple If/else
I am not an ASP programmer, but I need help with the syntax. I have a simple if/else statement that I need to translate into ASP. Begin Pseudocode if { (id == 1,2,3,4,5,6), then print "Private" } else { Print <a href="https://www.mydomain.com/file.asp?ID=<%=rs("ID")%>" target="_blank">Register</a> } End Pseudocode So how do I say this in ASP?
Simple Upload
i'm trying to create just a simple upload - fill in a form with the article title, and description - and select a file - i need to upload that file to the webserver, and then rename that file to the <% =Sartid %>.pdf any ideas where to get something this simple from? never done anything like this before - i'm guessing the FSO will be used?
Simple Sendmail With CDO
This code is working partially fine <% sch = "http://schemas.microsoft.com/cdo/configuration/" Set cdoConfig = Server.CreateObject("CDO.Configuration") cdoConfig.Fields.Item(sch & "sendusing") = 2 cdoConfig.Fields.Item(sch & "smtpserver") = "mail.aws.no" cdoConfig.fields.update Set cdoMessage = Server.CreateObject("CDO.Message") Set cdoMessage.Configuration = cdoConfig cdoMessage.From = Request.Form("E-Mail") cdoMessage.To = Request.Form("sendto") cdoMessage.Subject = "Tilbakemelding fra nettsiden" cdoMessage.TextBody = strBody cdoMessage.Send Set cdoMessage = Nothing Set cdoConfig = Nothing Response.redirect Request.form("resulturl") %> Well, this works with only some addresses and not others. Examples: bjorn@domain.no b@2.com will work... On the other hand: bjorn.kaa@domain.no bjorn-kaa@domain.no won't work at all...
Simple ASP Page
I need to send data from a 'form' on an HTML page to an ASP page. The ASP page should 'return' a simple HTML page containing the data from any items submitted, including any hidden items.
Simple Login
A user logs in, then based on their account (username/pass), they are redirected to a specific web address. I only need 3 different accounts. Can this be done with Javascript? Or do I need to use a database? If you can point me to some script that will achieve this I would love it!
Simple Problem
I got a small problem that I think you can solve in a sec.I use ASP to tell day, date, month etc on this page: http://www.aljapaco.com/award/nyawar...rd&val=purpose But,as the servers is in Sweden and I´m in Sweden to, I see the text in Swedish. Can anyone that lives in any other country just please tell me if the text is in English when youre not viewing it from a Swedish connection. IF it´s still in Swedish, how (if) can I make it change to English text or am I stuck with some messy old Java Script??
ASP Simple Upload
does anyone know of a good place to find code samples for ASP Simple Upload. I can't seem to get to the original site. What I need to do is upload the file and save the path and some other info into to a database.
|