Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking Databases to Websites

Status
Not open for further replies.

melocco

Technical User
Jan 19, 2001
229
US
I have a small Access database I made and I have made a small page in Dreamweaver (after falling on my face a few times).. I'm still really new at this and can't figure something out.. in my database I have some urls pointing to another site (IMDB) and for some reason when I put the page on the web it does something strange.. Instead of having it has # I can't figure out how to get rid of those #'s If some one knows, please let me know.. Thanks.. Webmaster@melocco.com Here is the site that I have made and you can see.. Thanks.. Mel...
 
Well the quick and dirty method would be to use a replace method before printing out the urls:
Code:
Dim myUrl
myUrl="#[URL unfurl="true"]http://www.tek-tips.com#"[/URL]

'Remove all occurrences of #
Response.Write Replace(myUrl,"#","")

or

'only print out the second character to the last but one character
Response.Write mid(myUrl,2,len(myUrl)-2)

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
This space has nothing in it, it's all ni your imagination
 
Hi,

Try changing the link Access data field format to "text". It's probably set for "Hyperlink".

Also, you'll need to enclose the HTTP link in a HTML tag:

Response.Write(&quot;<a href=&quot; & objRS.Fields(&quot;dblink&quot;) & &quot;> & objRS.Fields(&quot;dblink&quot;) & &quot;</a>&quot;) to get it to link.

Hope this helps!
 
Thanks, but where do I write that in at? I know you are going to laugh, but I'm using dreamweaver to make them...
so where in the code do I add that?

In the access db, change the colum where the URL is now from Hyperlink to Text and then in the space add <a href=&quot; and then the &quot;> on them all??

 
Hi,

Sorry no Dreamweaver exp here either.
I was assuming you were building your page of links by looping through a recordset. In which case the Response line would build the neccessary links. In Dreamweaver they are probably doing this for you. There must be some way to create a Hyperlink though.
Did changing the data type help or make any difference?

 
Oops and one more thing, you might be helped better at a Dreamweaver forum.

Thanks!
 
Jet supports a syntax in SQL statements for pulling out parts of it's hyperlink type, but I can't recall what it is. All I remember is that I looked at it once and couldn't make a lot of sense of it.

You might try something like &quot;select [fld].url from
&quot; or read up on Access' hyperlink type. Access has a function in VBA for pulling out the parts too. I always figured I'd use a Split() to break 'em up if I needed to.

The format is something like:

description#url#bookmark#tooltip in Jet 4.x (Access 2000)

and

description#url#bookmark in earlier versions of Jet.

I don't think SQL Server / MSDE support this type natively.
 
This is what I have, I have changed the database to be Text in that field and looked on the asp page and I can't find it.. This is what the ASP page looks like..

<%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;1252&quot;%>
<!--#include file=&quot;Connections/Movielist.asp&quot; -->
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Recordset1.ActiveConnection = MM_Movielist_STRING
Recordset1.Source = &quot;SELECT * FROM Movies ORDER BY ID ASC&quot;
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body>
<table width=&quot;75%&quot; border=&quot;1&quot;>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td><%=(Recordset1.Fields.Item(&quot;ID&quot;).Value)%></td>
<td><%=(Recordset1.Fields.Item(&quot;Movieslist&quot;).Value)%></td>
<td><%=(Recordset1.Fields.Item(&quot;Information&quot;).Value)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

That is what Dreamweaver made.. I hope some one can help.. I have made the page with Coldfusion and it works.. But with asp it has this... Not sure what else I can do.. Thanks again for all every ones help.. Mel...
 
one more thing I noticed, I have got a few in the list that skip.. Look at 489 then it goes to 491.. it skips 490.. I know it is in the access but I don't know how it is gone or how to fix it.. I think it happend when I had to delete it becuase I had repeated it some in my list (i.e. had the same movie listed twice).. If you know how to fix that, please let me know.. Thanks again.. Sorry to be sutch a pain.. Mel...
 
If the field is an autonumber field than you can't change it, this is a built in data integrity feature you will find in every database to keep an application from accessing a record by id that is actually a replacement using the same id.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 
Hi, I had the same problem. I solved this by adding the html code to the database field. For instance, if you have a column in your database that you called &quot;URL&quot; and you gave it the &quot;hyperlink&quot; data type, you could solve this problem by changing the data type back to &quot;text&quot;. Then when you are filling in the data in Access, you will have to add the html coding with it. So instead of simply typing &quot; in your &quot;URL&quot; column, you would type &quot;<a href=&quot;You can also adding more than one URL in the field this way.

It isn't the best way, but it works for me. The smarter way would be to fix up your asp page so that it adds the coding just before and after it, automatically creating a link.
 
I'll try that and see if it works.. If any one knows a way to fix the asp, please let me know.. I have about 500 lines I'd have to fix... Thanks in advance and I'll let you know about the progress of it... Mel....
 
Here is the fix for your ASP code:

From this;
<td><%=(Recordset1.Fields.Item(&quot;Information&quot;).Value)%></td>

To this:
<td><a href=&quot;<%=(Recordset1.Fields.Item(&quot;Information&quot;).Value)%>&quot;><%=(Recordset1.Fields.Item(&quot;Information&quot;).Value)%></a></td>


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top