473,725 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query strings

2 New Member
Hi, I'm Drew and I'm new here; and I could really use some help. I have a website in which I took offline because I found another host that will provide me with more space at a cheaper price. Before I temporarly took it offline to change domains, I decided I want to revamp the whole site, new layout, etc. Now I'll get to the question at hand. My website provides things such as news, sports, weather alot of stuff including a subdomain that features video sharing like Youtube. When I did my website in the past I used plain HTML, which is ok, but I've been using it for way to long and really want to change the method. I have rebuilt part of the site thus far using ASP, and with this ASP instead of having it like before, I.E. creating every page separtly, I want to have one page for every category. For example, when you go to your local network affiliate website their URLs look like this, theirsite.com/Global/Story.asp?S= or thiersite.com/Global/Category.asp?C= I want to do my site the same way, except without the /Global/ seperation. So for instance say you would come to my website and see a story about Bob eating a hamburger and that story was of some interest to you so you click on it and it would take you to Story.asp, then display the story you wanted and it would be displayed like this in the url mysite.com/story.asp?s=ran dom numbers instead of using the method I've used before which would of looked like this mysite.com/news/bob_eating_a_ha mburger.html

My question is, how do I go about doing this? I know how to create the main pages, I.E. story.asp, category.asp, etc. I just don't know how to get the stories, etc to diplay on the main pages. I'm using ASP and an access database.

I hope I haven't confused anyone, cause I think I just confused myself a little more. :-) Whatever help can be provided I will be so thankful with! I've looked everywhere and have asked on different forums, but no one answers. I have basic knowledge in ASP, PHP, HTML, HTM, and XML. So I really want to learn how to do this and advance a little more.

Thanks so much in advance!
Aug 5 '07 #1
3 1382
ilearneditonline
130 Recognized Expert New Member
My question is, how do I go about doing this? I know how to create the main pages, I.E. story.asp, category.asp, etc. I just don't know how to get the stories, etc to diplay on the main pages. I'm using ASP and an access database.
So let's start with the main page where you would be pulling from the database. I would suggest thinking about using a different db though, access isn't good for much of anything to complicated.

So on your main page you would have a link like...
[HTML] <a href="mysite.co m/story.asp?s=123 2345">The Story</a>[/HTML]

When clicked, this would take you to story.asp...
Expand|Select|Wrap|Line Numbers
  1. <%
  2. Dim storyid
  3. Dim rs, db, query ' variables for db connection, recordset, and querystring 
  4. ' s represents the query string parameter
  5. storyid = Request.QueryString("s")
  6.  
  7. query = "SELECT storyid, storytitle, storydetails FROM t_stories WHERE storyid=" & s
  8. db = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;"
  9. Set rs = Server.CreateObject("ADODB.Recordset")
  10.  
  11. rs.ActiveConnection = db
  12. rs.Source = query
  13. rs.CursorType = 0
  14. rs.CursorLocation = 2
  15. rs.LockType = 1
  16. rs.Open()
  17. %>
Hope that is enough to get you started.
Aug 5 '07 #2
drewski41
2 New Member
Thank you so much! I have one last question, then I should be set.

How do I save the stories, in .txt files, regular HTM format, or do I write them in a table in the database? If I do write them in a text file and or HTM format, do I then create a table in the database that links to it so it then will open and display in the appropriate place?

Thanks again!
Aug 6 '07 #3
ilearneditonline
130 Recognized Expert New Member
Thank you so much! I have one last question, then I should be set.

How do I save the stories, in .txt files, regular HTM format, or do I write them in a table in the database? If I do write them in a text file and or HTM format, do I then create a table in the database that links to it so it then will open and display in the appropriate place?

Thanks again!
My example suggests that you are saving it to a database. You could check out the w3school tuturial on ADO. It has everything you need to write the code. I wouldn't use .txt or html files. You should also look into doing some caching to speed up your site.
Aug 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1496
by: theboss3 | last post by:
I am having trouble with accessing files with query strings. For example the code "require 'template.php?102932'" gives the following error: Warning: main(/www/blog/template.php?102932): failed to open stream: Invalid argument in C:\www\blog\2004\12\27\best-of-2004\index.php on line 54 Fatal error: main(): Failed opening required
4
1311
by: Alistair | last post by:
I should just get a hat with a big D on it and then everyone would recognise me.. anyway... I have a DB full of people and their details.. I'm trying to perform a query based on age. so I have a form with two values..upperlimit and lowerlimit ( eg aged
6
29938
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access newsgroups, the access support centre, I can seem to find no similar situation. I am not using any references, or VBA at all in the first place. I am trying to set up a simple (or so I thought) query to work with the text of two tables. ...
2
1610
by: Oliver Block | last post by:
Hello, sometimes one can see that on some site there are query strings appended to a URL even if the requested document is of .html form. What sense does that make? I couldn't find anything in the w3 recs. Best Regards, Oliver
30
2335
by: Paul H | last post by:
I seem to end up with loads of append and update queries just because it's quick and easy to build queries or make a new ones based on an existing query. But I end up with loads of queries with long names like: qryfrmCustomers_Diary_DeleteEntriesBeforeADate qryfrmMaintenance_CloneOrder_Step1_CreateOrderIDAndDescription Am I being lazy? Should I code most of my action queries to tidy up the clutter in the database window?
12
5280
by: zwasdl | last post by:
Hi, I'm using MS Access to query against Oracle DB via ODBC. Is it possible to use HINT in Access? Thanks, Wei
13
1855
by: john | last post by:
I have table User-App and table App Profile User-App App Profile IDuser IDApp IDApp 1 34 34 1 45 45 2 34 2 45 2 90 3 34
3
1773
by: Nathan Guill | last post by:
I have an interface that works with an Access back-end. I would like to store and/or load user defined query strings per each user (i.e. no user can access another's queries). The idea I had was a "table" stored with the C# front-end (not in the Access database), but don't know if this is even possible. If it is, can someone let me know how? Otherwise, how do other people handle storing and loading query strings for possible later use?
17
2729
by: NeoAlchemy | last post by:
I am starting to find more web pages that are using a query parameters after the JavaScript file. Example can be found at www.opensourcefood.com. Within the source you'll see: <script src="/shared/scripts/common.js?revision=1.6" type="text/javascript">. I am trying to see if there is any big deal to this or a best practice that is starting to creep up in the JavaScript community. If this is used only as a way to distinguish what...
5
2325
by: Just_a_fan | last post by:
I tried to put an "on error" statement in a routine and got the message that I cannot user "on error" and a lamda or query expression in the same routine. Help does not list anything useful for explaining a "lamda" expression and so I don't know what one is and I am not doing any database stuff in the entire program. So what does this error message really mean and what can I do to get an On Error into the routine?
0
8750
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9256
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8091
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6701
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6010
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4509
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2154
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.