Dynamic titles from an access database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!!!!!!!!
 
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!!!!!!!!
|
|
 
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.
 
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
 
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!!!!!!!!!
 
The META tags should not include any field "formatting"
Try using replace to strip all crlf from the body1 field
<%= Replace(Rs("body1"), vbCrLf, " ")%>
 
Back
Top