# Help with ASP/vbscript code



## coachdan32 (Nov 13, 2003)

Thanks to anyone who will take the time to help. I am trying to setup what should be a simple database driven website. I have very little experience with this type of project and the code below is my first attempt at setting this up. The code I have was taken from snippets I was able to find and could quite possibly be completely wrong for what I need. I set up a SystemDSN and the database is MS Access. I am not sure how I can test the code as the website does not exist yet and I am not sure of the exact path of the DB, since a host has not been identified yet. Any steps I can get closer to working code will be helpful.

The table I am trying to setup needs to be able to grow with the number of records as they change and I would like to limit it to 3 columns per row. The Title should be listed with the FileName directly below it. The FileName will eventually be a .jpg that is found at the file path listed, but for the sake of getting started, I am settling on just the text of the FileName to start.



New Page 1

'Create DB connection
<%
set cnn = server.createobject("ADODB.Connection")
cnn.open "DRIVER = {Microsoft Access Driver (*.mdb)};DBQ=c:\My Webs\carlsweb.mdb"
%>

'Query Database for data
<%
SQL = SQL & " SELECT tblArt.Title, tblArt.Category, tblArt.FileName "

SQL = SQL & " FROM tblArt "
SQL = SQL & " WHERE tblArt.Category = "Animals"

Set rs=Server.CreateObject("ADODB.RecordSet")
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockOptimistic
rs.Open SQL, MyDSN
Set rs.ActiveConnection = Nothing

If rs.RecordCount<>0 Then
MAr = rs.GetRows()
End If

%>













[TR]
[TD]



*Animals*[/TD]
[/TR]​​




_*
Gallery
*











_




<%Title%><%FileName%>





*Shipping &
Handling Rates For Wildlife In Watercolor*



*Home ~
 Birds ~
Animals ~

Landscapes ~
 Seascapes ~
 Miscellaneous ~ 
How to Order ~ Contact Us*







*Add Hit Counter Here*





*This page was lasted edited
on [Insert Date]*





© 2005 _Wildlife In
Watercolor_

<%
rs.Close
Set rs=Nothing
%>


----------



## coachdan32 (Nov 13, 2003)

bump


----------



## Rockn (Jul 29, 2001)

Not sure what you are trying to do or where you want the database content to be displayed in the whole scheme of this page. If this is a static page why do you need a recordset unless the page content will be dynamic?


----------



## coachdan32 (Nov 13, 2003)

This for a friend that is an artist. He doesn't know anything about websites, but wants to be able to add new art to his website on his own. My intent is to have him upload his art images into his images folder and add the filename of the image to his DB and have it be added to the webpage that catalogs his art. The page I attached is for one of the categories of art he does. There are many different pieces of art in that category and I want to be able to display all of them (for that category) by having them pulled dynamically from the DB table. That way he can add a new piece of art to that category in the DB and have it added to this page without him having to know any HTML.


----------



## Rockn (Jul 29, 2001)

This will not be a no brainer for your friend I am afraid. Unless you get an upload component and modify it to update the database it will be an administrative headache for him. THere are free upload components that can be easily modified. You should also make a table for the categories and have it linked via PK to the table the image locations will be held in. Do you have a sample of the database you will be using and image names?


----------



## coachdan32 (Nov 13, 2003)

Yes, I have the database ready. I will post a copy when I return home. I was hoping to find a way for him to upload his pictures as you mention, but wasn't sure how difficult it would be to come up with. I thought even if I couldn't, he could go to the site administration tool and upload the jpg. I know it shouldn't be too difficult to give him a page to input his new work and have it added to the database. As far as the file path for the artwork, I thought I could hardcode the path into the page where it would be displayed somehow - he would only have to know the name he gave the jpg and enter it on the add page. If the path was hardcoded in, the rest should happen behind the scenes hopefully.

There are a lot of things I haven't figured out yet, as I am very new to DB driven content. I have to figure it out for him because his daughter was doing his site for him (static design) and she is in the hospital and may not survive to continue keeping it up for him. I would just take over for her, but time is a real issue for me most of the year as I administer the website in my signature for my son's HS baseball team and it keeps me quite busy 10 months out of the year. I appreciate your help and he will appreciate it even more, as this is his only means of income these days. He is getting too old to travel around to the art shows and market his talents.

Does what I have look to be correct for the most part? I know that I need some kind of For/Next loop or something to loop through through the records until they have all been pulled, but I am not sure how/where to put this to ensure there are 3 pics with the titles above them in each row. I know there needs to be a counter or something for the row with titles and also one for the pics (FileName), but cannot visualize how the two would work together. Any help you can give would be appreciated and I will post the DB tonight when I get home.


----------



## coachdan32 (Nov 13, 2003)

Here is the DB.


----------



## Rockn (Jul 29, 2001)

Don't use lookups for table fields, just use the values and join them with the same name. For instance, in the Art table create a categoryNo field set to number so it corresponds to your category table. You can still do joins in your SQL statements in your vb script. You also don't need to put the URL encoding into the file names in the tables. 

Unzip all of these files to the root of your web site and it should work.


----------



## coachdan32 (Nov 13, 2003)

I will give it a try when I return home. Thanks for all the help! You are appreciated.


----------



## coachdan32 (Nov 13, 2003)

It looks like what I want Rockn, but I'll have to find a server to test it on. I will get back probably on the weekend. I have to find a free site to test it with.


----------



## Rockn (Jul 29, 2001)

How were you gonna test ASP at home with XP Home? Anyway, you can install IIS on XP Home if you jump through a few hoops and then you could test locally.

http://www.15seconds.com/issue/020118.htm


----------



## coachdan32 (Nov 13, 2003)

I have an XP Pro machine as well. I have thought about installing IIS on it, but I don't know anything about it. Can you use PWS with XP?


----------



## Rockn (Jul 29, 2001)

IIS is better. PWS is really weak


----------



## coachdan32 (Nov 13, 2003)

Do you have a link(s) on how to set it up and administrate it? I would love to use it if I can learn how. Even if you can recommend a good book on the topic. I have not been able to find anything that seems to cover the topic.


----------



## Rockn (Jul 29, 2001)

IIS is easy to set up and administer. You can only have one site in XP, so you will have to disable the default web site. Install IIS from the Add/Remove windows components and we can go from there. ASP is one of the default server side languages and you can also run PHP and .Net if you are so inclined. Let me know when you get it installed.


----------



## coachdan32 (Nov 13, 2003)

Didn't see your post last night, but I will install it tonight. Thanks for the help. If you can only have one site, how do you handle multiple sites? Do you have to do sub-domains on any others?


----------



## Rockn (Jul 29, 2001)

You need a server version of IIS to run more than one site. You can make as many as you like and enable them when you want to work on them.


----------



## coachdan32 (Nov 13, 2003)

OK, I have IIS installed. Now what do I do?


----------



## Rockn (Jul 29, 2001)

I misspoke before about the multiple sites, but there is a tool that will help you add additional sites and you can still manage them from IIS admin, it's an extra step, but it works. http://www.firstserved.net/services/iisadmin.php

Make a directory where you want all of your web page project stuff stored. IIS install does make a inetpub\wwwroot folder on your C drive so you can use that and make project folders (web site folders) inside of that.

Opem the Tool you just installed and run it. Create a new web site that corresponds to the folder you just added to the inetpub\wwwroot folder. This will be the root of your web site. Close the tool.

Go to Control Panel > Administrative Tools and the IIS admin tool should be in there or you can copy that shortcut and plop it on the desktop. Start IIS and click the top level folder called Web sites. THis should show the default web site and the new web site on the right and show them both as stopped. Right click the new one and select start, right click again and select properties. You really only need to make a couple of changes for a generic web site. Go to the Home directory tab, the local path can be changed if you messed up with the tool, nothing else should need to be changed here unless you have problems with permissions or scripts not running. Next go to the Documents tab, this is where you define the default home page. If you are using default.asp as your home page make sure it is in the list and at the top. Test your site by entering http:\\localhost into your browser.

That's it in a nutshell.


----------



## coachdan32 (Nov 13, 2003)

"Make a directory where you want all of your web page project stuff stored. IIS install does make a inetpub\wwwroot folder on your C drive so you can use that and make project folders (web site folders) inside of that."

I want to keep them all where they are (C:/My Webs)

"Opem the Tool you just installed and run it. Create a new web site that corresponds to the folder you just added to the inetpub\wwwroot folder. This will be the root of your web site. Close the tool."

Not sure what you mean. I installed the IIS from the Add Windows Components and it ran the wizard to install. The only place I see to open IIS is the Administrative Tools.


----------



## Rockn (Jul 29, 2001)

> I want to keep them all where they are (C:/My Webs)


Use the tool I told you to download, create a new site and point it to the directory you want. If you are dead set on C:\my webs so be it. I would however steer away from using directory structure naming with spaces in folder names.



> Not sure what you mean. I installed the IIS from the Add Windows Components and it ran the wizard to install. The only place I see to open IIS is the Administrative Tools.


Download and install the tool I mentioned in the link above.


----------



## coachdan32 (Nov 13, 2003)

I could not get the tool to run and had to uninstall it. I got an error when trying to run it saying that an ActiveX file could not run. Maybe I better just go with the one site IIS allows. How do I set it up that way?


----------



## Rockn (Jul 29, 2001)

Same way as before:

Go to Control Panel > Administrative Tools and the IIS admin tool should be in there or you can copy that shortcut and plop it on the desktop. Start IIS and click the top level folder called Web sites. THis should show the default web site and the new web site on the right and show them both as stopped. Right click the new one and select start, right click again and select properties. You really only need to make a couple of changes for a generic web site. Go to the Home directory tab, the local path can be changed if you messed up with the tool, nothing else should need to be changed here unless you have problems with permissions or scripts not running. Next go to the Documents tab, this is where you define the default home page. If you are using default.asp as your home page make sure it is in the list and at the top. Test your site by entering http:\\localhost into your browser.


----------



## coachdan32 (Nov 13, 2003)

I will take a look at it tonight when I get home from work. I don't remember their being any folders showing on the tool, but I will look around then.


----------



## coachdan32 (Nov 13, 2003)

Here is what I have visible (no folders):


----------



## Rockn (Jul 29, 2001)

No default web site huh....odd. I don't thin it will work regardless and I think it might be related to your earlier problem installing that tool and ActiveX. I would disable all firewalls and AV software antr try reinstalling IIS and the tool. It may also be an IE setting if your security settongs are too high.


----------



## coachdan32 (Nov 13, 2003)

I will try some of that tonight


----------



## coachdan32 (Nov 13, 2003)

OK, I removed all firewalls and set my IE settings to Medium default. I was able to get both apps installed and complete all your instructions, but I get Page Not Found when I go to http://localhost. Any suggestions?


----------



## Rockn (Jul 29, 2001)

Localhost is only available on the computer you installed IIS on. Did you start the web site and define a default document?


----------



## coachdan32 (Nov 13, 2003)

I am not sure. I took the files you sent me and put them in a new folder in C:/My Webs/Test, then I went into the IISAdmin tool I downloaded from the link you gave me and added the Test web, then I stopped the Default site and started the Test site. In the tool there are 2 websites (Default and Test). Default shows stopped and Test shows started. If I go into the IIS Administration tool in control panel both sites show up in the websites folder. I right-clicked and went to properties for the Test site and made the following changes:

1.On the Home Directory tab, I changed the local path to point at C:/My Webs/Test
2.On the Documents tab, I added index.asp (which is what I named the webpage you helped me with) and moved it to the top position

That is the extent of what I did. Then I went into IE and entered http://localhost and got page not found. All of this was done on the PC that IIS was installed on.


----------



## coachdan32 (Nov 13, 2003)

bump


----------



## covert215 (Apr 22, 2006)

is your IIS configured to accept home pages w/ the .asp extension? try a sample .htm document


----------



## Rockn (Jul 29, 2001)

Might want to try disabling your firewall again if it is running.


----------



## coachdan32 (Nov 13, 2003)

Will I have to disable the firewall everytime I want to work on a website?


----------



## coachdan32 (Nov 13, 2003)

Disabling the firewwall did not help. How do I configure it to accept .asp?


----------



## covert215 (Apr 22, 2006)

Did using a file w/ a different extension work?


----------



## coachdan32 (Nov 13, 2003)

I didn't have a chance to check it last night, I will check it tonight.


----------



## Rockn (Jul 29, 2001)

coachdan32 said:


> Disabling the firewwall did not help. How do I configure it to accept .asp?


ASP is a default and should work out of the box. You could also try your local IP address. The default web site has to be stopped if it's not already and the new one you added needs to be running.


----------



## coachdan32 (Nov 13, 2003)

Would it be my internal IP or my real IP? I have an unroutable IP within my network (192.168.1.xxx).


----------



## coachdan32 (Nov 13, 2003)

Neither the WAN or the LAN IP works. The LAN returns Page Not Found and the WAN loops back to my router config page.


----------



## Rockn (Jul 29, 2001)

Take a screenshot of the IIS settings. Click the server name and the web sites should show up on the right and whether or not they are started. Try doing the http://192.168.1.xxx/index.asp to see if it brings up the web page.


----------



## coachdan32 (Nov 13, 2003)

IP/PageName did not work. Here is the screenshot. Could it be the router not allowing it to display?


----------



## Rockn (Jul 29, 2001)

Double click on test, it should show all of the directory structure in your My webs folder or whatever folder you designated as the root for the web site. If it doesn't go back into the properties for the web site in IIS and define the correct directory.


----------



## coachdan32 (Nov 13, 2003)

I have attached screenshots of all of my settings in IIS, any tab that was omitted did not show any settings and no changes to default settings were made on these tabs. Hopefully this will help shed some light on the problem.


----------



## Rockn (Jul 29, 2001)

And when you open the http://localhost in IE or firefox it states the web site cannot be found? Is it a 404 error or an 550 error? It may also not give an error because of an IE setting if you are running IE as your browser.


----------



## coachdan32 (Nov 13, 2003)

It is a 500 error - The Page Cannot Be Found. I reset the IE settings to the default and still get the error.


----------



## Rockn (Jul 29, 2001)

500 errors are generally security or script related amd 404 is page cannot be found. Change this setting in IE and it should display your page error.

http://www.frontpagewebmaster.com/m-235653/tm.htm

I am sure the path to your database will be the error.


----------



## coachdan32 (Nov 13, 2003)

Here is what it displays now:

Server Application Error
The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance.

I looked on the Event Viewer under Administrative Tools, as this was the only place I knew to look at events. It did not list an event under the Application Events since 8/3 when it showed IISAdmin being successfully installed.


----------



## Rockn (Jul 29, 2001)

Make a simple ASP page that will print out todays date and put it in the root of your web site.

Create a new ASP page and put this in the body:

<%= Date() %>

Save it to the root and try to run it in your web browser. There should not be this many problems trying to run a simple web site in IIS. Your XP installation must have issues or some security software you have is messing stuff up.


----------



## coachdan32 (Nov 13, 2003)

I took all scripts out of the page except the date code and still get this error:

Server Application Error
The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance

It pretty much has to be a server/security setting or firewall issue. Any ideas???


----------



## Rockn (Jul 29, 2001)

Did you look in your event log?


----------



## coachdan32 (Nov 13, 2003)

Last time I looked on the Event Viewer under Administrative Tools, as this was the only place I knew to look at events. It did not list an event under the Application Events since 8/3 when it showed IISAdmin being successfully installed. Is there another event log besides that? I will check it again when I get home though.


----------



## coachdan32 (Nov 13, 2003)

Here is a screenshot of the only thing that seems to apply


----------



## coachdan32 (Nov 13, 2003)

Sorry it was unreadable.

The browser has forced an election on network \Device\NetBT_Tcpip_{E8A5C0CB-7EE4-4026-9EB9-AA3EE72839A7} because a master browser was stopped.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


----------



## Rockn (Jul 29, 2001)

That error doesn't have anything to do with IIS. I would look in the application log or in the web server logs in the system32\logfiles folder, the log for the web site is w3sv...something.


----------



## coachdan32 (Nov 13, 2003)

There are 2 folders inthe system32 folder, here are the most recent entries in them. The date that corresponds with the date of my last test was 8/11/06, which has an entry in the W3Svc2 folder.

Folder "W3Svc2"

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-08-11 21:12:14
#Fields: time c-ip cs-method cs-uri-stem sc-status 
21:12:14 127.0.0.1 GET /adj/N3285.insightbb/B1876474;abr=!ie;dcadv=1055044;sz=120x600;ord=30850 404
21:12:14 127.0.0.1 GET /adi/N3285.insightbb/B1876474;dcadv=1055044;sz=120x600;ord=30850 404
21:12:22 127.0.0.1 GET /pagead/show_ads.js 404
21:12:22 127.0.0.1 GET /counter/counter.js 404
21:12:23 127.0.0.1 GET /urchin.js 404
21:12:31 127.0.0.1 GET /pagead/show_ads.js 404
21:12:31 127.0.0.1 GET /counter/counter.js 404
21:12:31 127.0.0.1 GET /urchin.js 404
21:12:40 127.0.0.1 GET /pagead/show_ads.js 404
21:12:40 127.0.0.1 GET /pagead/show_ads.js 404
21:12:40 127.0.0.1 GET /pagead/show_ads.js 404
21:12:42 127.0.0.1 GET /counter/counter.js 404
21:12:42 127.0.0.1 GET /urchin.js 404
21:14:33 127.0.0.1 GET /pagead/show_ads.js 404
21:14:35 127.0.0.1 GET /counter/counter.js 404
21:14:35 127.0.0.1 GET /urchin.js 404
21:19:27 127.0.0.1 GET /pagead/show_ads.js 404
21:19:27 127.0.0.1 GET /pagead/show_ads.js 404
21:19:29 127.0.0.1 GET /counter/counter.js 404
21:19:29 127.0.0.1 GET /urchin.js 404
21:24:00 127.0.0.1 GET /DEI/view/neu0040000410dei/direct/01/ 404

Folder "W3SVC1"

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2006-08-03 04:22:25
#Fields: time c-ip cs-method cs-uri-stem sc-status 
04:22:25 127.0.0.1 GET /pagead/show_ads.js 404
04:22:25 127.0.0.1 GET /counter/counter.js 404
04:22:29 127.0.0.1 GET /__utm.gif 404
04:23:14 127.0.0.1 GET /pagead/show_ads.js 404
04:23:14 127.0.0.1 GET /counter/counter.js 404
04:23:14 127.0.0.1 GET /counter/counter.js 404
04:23:16 127.0.0.1 GET /urchin.js 404
04:23:21 127.0.0.1 GET /pagead/show_ads.js 404
04:23:21 127.0.0.1 GET /pagead/show_ads.js 404
04:23:24 127.0.0.1 GET /counter/counter.js 404
04:23:24 127.0.0.1 GET /__utm.gif 404


----------



## Rockn (Jul 29, 2001)

Looks like you don't have your web site set up unless these pages are part of the web sites you defined. These pages are from Google Adsense and I don't know why they are showing up in your web logs. The uchin.js is a part of google analytics. Something is seriously messed up on your computer.

Put a generic HTML page in the root of the web site and see if it even pulls that up.


----------



## coachdan32 (Nov 13, 2003)

Sorry it took so long to get back on this, I have been real busy. I created a new index.asp page (which is the root target) and only put the word TESTING on it. Saved it to the same C:/My Webs/Test folder and got the same error as before. Where do I go from here? Apparently something is not quite right.


----------



## Rockn (Jul 29, 2001)

I would try all of this on another machine, there is obviously something wrong with this one or your logged in account does not have the correct permissions. Could also be that you have security or virus software blocking the functionality.


----------



## coachdan32 (Nov 13, 2003)

I am kind of between a rock and a hard place here. My other machines are not XP Pro, so I can't run IIS on them. I checked my account and it is definately setup as an administrator account, so it should have permissions to allow it. I don't have anything out of the ordinary in the way of security software - I run Adaware and Spyware Blaster. I looked through my router admin and don't see anything there that could be a problem. The only thing out of the ordinary is a SQL Admin account on the machine, as I have SQL server and Visual Interdev on the machine. The thought comes to mind that that may be a problem. I haven't done anything with Interdev since installing, but doesn't it have something to view served pages? I hadn't done anything with it because it is kind of complicated and I have not found any tutorials on using it yet.


----------



## Rockn (Jul 29, 2001)

If you had Win2K you could set up IIS on that as well.


----------



## coachdan32 (Nov 13, 2003)

Other machines are XP Home. I have heard that you can make some changes and run it on Home, but those machines are on my network and have the same AV/Spyware tools running on them.


----------



## Rockn (Jul 29, 2001)

So you are saying that it will not even serve a plain jane HTML page that you have placed in your web root correct? localhost/plainjae.html

Try running plain html and look in your most current log file for an error that corresponds to the date and time of the error page displayed.


----------



## coachdan32 (Nov 13, 2003)

"So you are saying that it will not even serve a plain jane HTML page that you have placed in your web root correct? localhost/plainjae.html"

Are you saying that I need to include a file name after the "http://localhost/"? That could be the whole problem. I was literally entering "http://localhost" and GO. I was not aware that I needed to include a file name after it. I will try that tonight and see if I have results. I told you I had no idea how to use the program. If that was the problem, I will be embarassed.


----------



## Rockn (Jul 29, 2001)

Unless you define whatever page you are trying to open as the default document you need to append the name of the file and extension to the url.


----------



## coachdan32 (Nov 13, 2003)

I moves index.asp to the top of the list on the tab in IIS where you can select the homepage. It didn't work anyway. I tried "http://localhost/index.asp" and got the same error. Then I added the home folder to it "http://localhost/Test/index.asp" and it gave page not found.


----------



## Rockn (Jul 29, 2001)

Would it be possible to RDP in and take a look at it?


----------



## coachdan32 (Nov 13, 2003)

Is RDP Remote Desktop? I am not familiar with the RDP term. If it is, I am willing to try that if you are. I am not sure how to set that up as far as my firewall goes, but I also have netmeeting as an option and I already have my firewall configured to allow that. The only for sure time I will have is on Saturday or Sunday though. My weekdays are hit or miss, as I have to provide transportation to my son for his job until he gets his license.


----------



## Rockn (Jul 29, 2001)

I suppose NetMeeting will work. If you want to use RDP(Remote Desktop) all you need to do is port forward port 3389 on your router to the machine you are having the problem with. PM me with whatever works.


----------



## coachdan32 (Nov 13, 2003)

If you don't already have Netmeeting setup, it will take considerably more work for you to setup for it. I will give Remote Desktop a go. Do you have a preference on when you are able to do it? I appreciate the extra effort you have put into helping me on this project. If I can get this website done for him, he will be eternally grateful to the both of us. Thanks!


----------



## Rockn (Jul 29, 2001)

Like I said, PM me and I can do it pretty much any time after 5:00 PM central.


----------



## coachdan32 (Nov 13, 2003)

Rockn,
I apologize, I didn't see your post until now (Sunday). I hope I didn't cause you any inconvenience by holding you up from doing something Saturday. I was on-line a bit Saturday morning, but was working on a different approach in hopes to get something going in a different direction. I installed wamp5 on my other machine and got an Apache/PHP/MySQL webserver setup thinking that if I could I might be able to test it on that. I got it up and running and can view webpages on localhost as I should, but however it won't allow me to view anything with scripting in it. I am suspecting it is because the script is vbscript and I seem to remember that Apache will only do PHP. I didn't think of that until after trying without success to display the <%=Date()%> test. I still have the IIS setup on the other machine and if you still are willing to take a look at that, I am going to be home all day today. If not, then I may try to get the code you provided me converted over to PHP and start learning it. I will check back here every hour or so to see if you post back and if if you want to do it today, I will PM you my email address or whatever you need to RDP. Again, I apologize for not seeing your post about Saturday.


----------



## coachdan32 (Nov 13, 2003)

OK, as I PM'd you, I got it to work in IIS by fixing the file path. I am posting a screenshot of the results, which only lists three items (which is because only 3 have FileNames). I added another and refreshed and it was added - so it is working correctly. Now, I have two other immediate needs:

1. Where the FileName is text, I would like to display the actual jpg image?
2. Instead of having the Title with the image beside it, I would like to have the Title over the image. And would like to limit the number of pieces of art to 3 in a row before starting a new row.

Is this possible? If I can get this functionality and do a bit of formatting cleanup, I can use this as a template for all of the pages.

Here is the code you provided, in case you didn't keep a copy.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<%
Dim rst
Dim rst_numRows

Set rst = Server.CreateObject("ADODB.Recordset")
rst.ActiveConnection = MM_cnn_STRING
rst.Source = "SELECT tblArt.Title, tblArt.FileName, tblCategory.Category FROM tblCategory INNER JOIN tblArt ON tblCategory.CategoryNo = tblArt.CategoryNo WHERE tblCategory.Category='Animals' and tblArt.FileName <> ''"
rst.CursorType = 0
rst.CursorLocation = 2
rst.LockType = 1
rst.Open()

rst_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rst_numRows = rst_numRows + Repeat1__numRows
%>

New Page 1

















[TR]
[TD]

*Animals*[/TD]
[/TR]​​




_*
Gallery
*










_




<%=(rst.Fields.Item("Title").Value)%><%=(rst.Fields.Item("FileName").Value)%>

<% 
While ((Repeat1__numRows <> 0) AND (NOT rst.EOF)) 
%>

<% 
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rst.MoveNext()
Wend
%>






*Shipping &
Handling Rates For Wildlife In Watercolor*



*Home ~
 Birds ~
Animals ~

Landscapes ~
 Seascapes ~
 Miscellaneous ~ 
How to Order ~ Contact Us*







*Add Hit Counter Here*





*This page was lasted edited
on [Insert Date]*





© 2005 _Wildlife In
Watercolor_

<%
rst.Close()
Set rst = Nothing
%>


----------



## Rockn (Jul 29, 2001)

First make an image directory to hold your images and place the graphics in there. A title over the image really isn't a good idea because the text will get lost in the background or foreground whatever color that might be. For instance, if you have an image that is almost black and put black text over it you can see how that might cause a problem. Same thing goes if you set your text to black.


----------



## coachdan32 (Nov 13, 2003)

I've confused you on what I am looking to do. Let me give you a link to his current site so you can see what I mean. The current site is not done dynamically.

http://www.wildlife-in-watercolor.com/

Go to the Animals page. I was wrong, the Title is under the image, instead of over. Either way is fine, but now you should get concept I am looking to do. I made the decision to limit the images per row to three so they wouldn't all be placed in one long row of images. No matter what size the image is, I should be able to get three to the row.

I want the contents of the gallery to come from the database dynamically so he can make the changes w/o knowing html. If I can get this page laid out, the only thing that differs from page to page in the gallery will be the WHERE clause in the SQL statement. I will use this page as a template and change the WHERE to whatever page is linked to from the menu.


----------



## Rockn (Jul 29, 2001)

I understand now. Let me work on it a bit to see what I can come up with.


----------



## coachdan32 (Nov 13, 2003)

Thanks, I'm going to try to clean up some of my formatting in the interim. I have some cell padding issues and such to contend with because I am using tables instead of css. I don't know css yet, but I am trying to pick it up in my SPARE time. I know you know what I mean.


----------

