PDA

View Full Version : Database help changing from asp to htm


carol
04-22-2003, 12:09 PM
Hi i have a question that i hope some one can answer for me

I am making a page that access records from a mySql database. I can get all these records to display in a asp page but i am required to use a htm file type page

Does anyone know if this is possible and how to acheive this

The code i am using is :

The sql:

<% fldShowID = request.querystring("fldShowID")%>
<% dim sql

sql = " SELECT * FROM tblshowcase , TBLIMAGE , tblArticle "

sql = sql & " WHERE fldShowID = '" & fldShowID & "'"
sql = sql & " AND tblshowcase.fldArtID = tblArticle.fldArtID "
sql = sql & " AND TBLIMAGE.fldImgID = tblshowcase.fldImgID "

oC.open CS

oRS.open sql,CS
%>

The database field is fldShowDescription

<td height="149"><font face="Verdana, Arial, Helvetica, sans-serif"><strong>Description</strong></font><br><% = oRS("fldShowDescription")%></td>

In a htm page is just doesn't seem to see this information
Any advice would be greatly appreciated

christrinder
04-22-2003, 12:47 PM
By an html page I assume you mean the file extension is .html. From my (limited) understanding, the server will not do anything with the file unless there is the .asp (or similar) extension. Why do your files need to be HTML?

carol
04-22-2003, 01:08 PM
Yes that is correct i mean the file extention need to be a htm file type (same as html) as far as i know

And the reason for this is that for the project i am working on my job is to just add the database fields to a page that has been created by another department and i am not mean't to change this file type (as they do not want to take the chance of it effect their work)

christrinder
04-22-2003, 01:40 PM
As far as I understand it, to display a database's records on a page, the page must be processed using a server-side programming language, such as ASP or PHP. Therefore, the html page must be an ASP or PHP page. The primary difference is the file extension. The rest of the HTML on the page will still be processed as usual, so it shouldn't affect the other people's work, but to display the records, the pages must have the ASP file extension, otherwise the Server will not do anything with the page before the browser recieves it. Hope that makes sense. If you want more info, have a look at:
www.w3schools.com/asp/

carol
04-22-2003, 01:58 PM
Thank you so much for your advice

And yes that does make sense
i was looking to do the impossible again :)

That site you place a link in for was great i hadn't seen that site before there is a couple of areas there i had been looking for information about.

So thank you very much

Roy Sinclair
04-22-2003, 04:11 PM
Carol,

What you ask isn't impossible but it does have ramifications, it is possbile to adjust the IIS server to treat .htm or .html pages just like .asp so you can keep the .htm extension but the downside is that it will create additional overhead for every ordinary .htm page on your server as it's scanned for code to be executed. It would be better to work at removing whatever restriction has been placed that requires the page to be namd using .htm as the extension.

carol
04-23-2003, 10:30 AM
Thanks for the advice

I am going to put in a submittion to my project manager with all this information in mind and allow them to have the final say on this matter.

Regardless of the outcome it was great to find out it can be done and how incase the decission is to keep this page htm

So thankyou