Dynamic titles from an access database

W

weismana81

I've been working on this forever, and can't quite get it working right. I
posted here a long time ago, and thought I had it working but.... well...
no....

I'm trying to use a database field as my title. This is what I have so far...

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "connection works fine"
%>
<% strTitle = Request("tutorialID")%>

bla bla bla

<TITLE>Tutorial Detail: <%=strTitle%></TITLE>

This works as it should. But of course, using a number as a page title is
not very descriptive and will not make SE happy either for that matter.

So, when I try to replace "tutorialID" with "name" I get nothing (name being
another field in the db). Well I get "Tutorial Detail:".

What am I doing wrong? Am I missing something? This is really getting the
better of me so if anyone of you people that are 20 times as smart as I am
could shead some light, it would be super appreciated!!!!!!!!
 
S

Stefan B Rusynko

Is name a memo field w/ line breaks in it, or a text field w/o line breaks




| I've been working on this forever, and can't quite get it working right. I
| posted here a long time ago, and thought I had it working but.... well...
| no....
|
| I'm trying to use a database field as my title. This is what I have so far...
|
| <%
| set conn=Server.CreateObject("ADODB.Connection")
| conn.Provider="Microsoft.Jet.OLEDB.4.0"
| conn.Open "connection works fine"
| %>
| <% strTitle = Request("tutorialID")%>
|
| bla bla bla
|
| <TITLE>Tutorial Detail: <%=strTitle%></TITLE>
|
| This works as it should. But of course, using a number as a page title is
| not very descriptive and will not make SE happy either for that matter.
|
| So, when I try to replace "tutorialID" with "name" I get nothing (name being
| another field in the db). Well I get "Tutorial Detail:".
|
| What am I doing wrong? Am I missing something? This is really getting the
| better of me so if anyone of you people that are 20 times as smart as I am
| could shead some light, it would be super appreciated!!!!!!!!
|
|
 
K

Kathleen Anderson [MVP - FrontPage]

I *think* if you are using <% strTitle = Request("tutorialID")%> to grab
the field that it has to be the value passed from the search field on the
previous page.
 
M

MikeR

This should point up what Stefan and Kathleen are getting at.

To check what you are getting into this page, put this at the top of it. If you are using
a form to submit to this page, use as is. If you are attaching values to the URL, replace
..form with .querystring.
<%
Response.write request.form
response.end
%>
MikeR
 
W

weismana81

To Kathleen:
I'm pretty sure that you helped me with my first post about this!!! Well,
you hit it right on... again. I don't know why I didn't think about this,
but that WAS the problem. The reason that the tutorialID was working was
because I was using that in my perameters to get from the list to the details
page. Sure enough, I added the name field in the perameters, and it worked
as it should. Thanks so much. Yep... 20 times smarter!!!!

To Stefan:
This field is ok. But, as a matter of fact, I am trying to use the field
"body1" as my meta description. It IS a memo field with line breaks. This
is giving me a type mismatch error, and I'm assuming that is the reason. Can
I not use a memo field for the description tag?

Thank you all very much!!!!!!!!!
 
S

Stefan B Rusynko

The META tags should not include any field "formatting"
Try using replace to strip all crlf from the body1 field
<%= Replace(Rs("body1"), vbCrLf, " ")%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top