gotchi
asked on
Email Address hyperlinks?
Hello
Im wondering if anyone can help me with this... Im using ms access as my database with jsp. I have a column that holds email addresses, when I search for a particular person, and they are retreived, how will i be able to click on the email address, when the record comes up and open it up in my OutLook Express. so that the user can type in a message if they want to. Does the hyperlink have to set in Access or is the a way of coding it in jsp.
Please help
Im wondering if anyone can help me with this... Im using ms access as my database with jsp. I have a column that holds email addresses, when I search for a particular person, and they are retreived, how will i be able to click on the email address, when the record comes up and open it up in my OutLook Express. so that the user can type in a message if they want to. Does the hyperlink have to set in Access or is the a way of coding it in jsp.
Please help
ASKER
That sort of worked, it did open in outlook express but i have a table, so when the values are returned i.e name, surname and the email address i shud be able to click on the email address. At the moment when it runs....
=RS.getString("EmailAddres s" shows at the top of my table, and my email column is blank... my code is below
<table BORDER WIDTH="100%" >
<tr>
<td><b>First Name</b></td>
<td><b>Surname</b></td>
<td><b>Address</b></td>
<td><b>Phone number</b></td>
<td><b>Email Address</b></td>
</tr>
<%
while(RS.next())
{
%>
<tr>
<td><%=RS.getString("First Name") %></td>
<td><%=RS.getString("Surna me") %></td>
<td><%=RS.getString("Addre ss") %></td>
<td><%=RS.getString("Numbe r") %></td>
<a href="mailto:<%=RS.getStri ng("EmailA ddress")%> ">=RS.getS tring("Ema ilAddress" )</a>
</tr>
<% } %>
<%
RS.close();
connection.close();
=RS.getString("EmailAddres
<table BORDER WIDTH="100%" >
<tr>
<td><b>First Name</b></td>
<td><b>Surname</b></td>
<td><b>Address</b></td>
<td><b>Phone number</b></td>
<td><b>Email Address</b></td>
</tr>
<%
while(RS.next())
{
%>
<tr>
<td><%=RS.getString("First
<td><%=RS.getString("Surna
<td><%=RS.getString("Addre
<td><%=RS.getString("Numbe
<a href="mailto:<%=RS.getStri
</tr>
<% } %>
<%
RS.close();
connection.close();
try this:
=RS.getString("EmailAddres s" shows at the top of my table, and my email column is blank... my code is below
<table BORDER WIDTH="100%" >
<tr>
<td><b>First Name</b></td>
<td><b>Surname</b></td>
<td><b>Address</b></td>
<td><b>Phone number</b></td>
<td><b>Email Address</b></td>
</tr>
<%
while(RS.next())
{
String emailAddress = RS.getString("EmailAddress ");
%>
<tr>
<td><%=RS.getString("First Name") %></td>
<td><%=RS.getString("Surna me") %></td>
<td><%=RS.getString("Addre ss") %></td>
<td><%=RS.getString("Numbe r") %></td>
<a href="mailto:<%=emailAddre ss%>"><%=e mailAddres s%></a>
</tr>
<% } %>
<%
RS.close();
connection.close();
CJ
=RS.getString("EmailAddres
<table BORDER WIDTH="100%" >
<tr>
<td><b>First Name</b></td>
<td><b>Surname</b></td>
<td><b>Address</b></td>
<td><b>Phone number</b></td>
<td><b>Email Address</b></td>
</tr>
<%
while(RS.next())
{
String emailAddress = RS.getString("EmailAddress
%>
<tr>
<td><%=RS.getString("First
<td><%=RS.getString("Surna
<td><%=RS.getString("Addre
<td><%=RS.getString("Numbe
<a href="mailto:<%=emailAddre
</tr>
<% } %>
<%
RS.close();
connection.close();
CJ
ASKER
hi,
we are getting a lot closer now:) The email address is showing now,but it is still sitting on top of the table. I have tried to move the code about, but it wont budge! :)
we are getting a lot closer now:) The email address is showing now,but it is still sitting on top of the table. I have tried to move the code about, but it wont budge! :)
I don't understand that it is on top of the page and it won't budge?
Are you sure your changes in the JSP are showing up?
delete your work directory and then try accessing the page.
CJ
Are you sure your changes in the JSP are showing up?
delete your work directory and then try accessing the page.
CJ
ASKER
what I mean is whilst all the returned values i.e. name, surname etc, are in each of their individual columns, the email address column is blank, beacuse the email address returned is at the top of the table and not in the actual column.
missing the wrapping <td> I think :-)
=RS.getString("EmailAddres s" shows at the top of my table, and my email column is blank... my code is below
<table BORDER WIDTH="100%" >
<tr>
<td><b>First Name</b></td>
<td><b>Surname</b></td>
<td><b>Address</b></td>
<td><b>Phone number</b></td>
<td><b>Email Address</b></td>
</tr>
<%
while(RS.next())
{
String emailAddress = RS.getString("EmailAddress ");
%>
<tr>
<td><%=RS.getString("First Name") %></td>
<td><%=RS.getString("Surna me") %></td>
<td><%=RS.getString("Addre ss") %></td>
<td><%=RS.getString("Numbe r") %></td>
<td><a href="mailto:<%=emailAddre ss%>"><%=e mailAddres s%></a></t d>
</tr>
<% } %>
<%
RS.close();
connection.close();
CJ
=RS.getString("EmailAddres
<table BORDER WIDTH="100%" >
<tr>
<td><b>First Name</b></td>
<td><b>Surname</b></td>
<td><b>Address</b></td>
<td><b>Phone number</b></td>
<td><b>Email Address</b></td>
</tr>
<%
while(RS.next())
{
String emailAddress = RS.getString("EmailAddress
%>
<tr>
<td><%=RS.getString("First
<td><%=RS.getString("Surna
<td><%=RS.getString("Addre
<td><%=RS.getString("Numbe
<td><a href="mailto:<%=emailAddre
</tr>
<% } %>
<%
RS.close();
connection.close();
CJ
I think previous comment is true but forgot to close tag table
<table BORDER WIDTH="100%" >
<tr>
<td><b>First Name</b></td>
<td><b>Surname</b></td>
<td><b>Address</b></td>
<td><b>Phone number</b></td>
<td><b>Email Address</b></td>
</tr>
<%
while(RS.next())
{
String emailAddress = RS.getString("EmailAddress ");
%>
<tr>
<td><%=RS.getString("First Name") %></td>
<td><%=RS.getString("Surna me") %></td>
<td><%=RS.getString("Addre ss") %></td>
<td><%=RS.getString("Numbe r") %></td>
<td><a href="mailto:<%=emailAddre ss%>"><%=e mailAddres s%></a></t d>
</tr>
<% } %>
<%
RS.close();
connection.close();
%>
</table>
<table BORDER WIDTH="100%" >
<tr>
<td><b>First Name</b></td>
<td><b>Surname</b></td>
<td><b>Address</b></td>
<td><b>Phone number</b></td>
<td><b>Email Address</b></td>
</tr>
<%
while(RS.next())
{
String emailAddress = RS.getString("EmailAddress
%>
<tr>
<td><%=RS.getString("First
<td><%=RS.getString("Surna
<td><%=RS.getString("Addre
<td><%=RS.getString("Numbe
<td><a href="mailto:<%=emailAddre
</tr>
<% } %>
<%
RS.close();
connection.close();
%>
</table>
so does it work now?
CJ
CJ
ASKER
nope that didnt make a difference, whether the tag was there or not :( the email address is still not in the email column.
What now?
gotchi
What now?
gotchi
can you post your current code.
Thanx,
CJ
Thanx,
CJ
ASKER
This is my code as it currently stands
String sql = ""
+ " SELECT FirstName, LastName, Address, PhoneNumber, EmailAddress "
+ " FROM Employee"
+ " WHERE FirstName = '" + request.getParameter("Firs tName") + "'"
+ " AND LastName = '" + request.getParameter("Last Name") + "'";
java.sql.PreparedStatement statement = connection.prepareStatemen t(sql);
ResultSet RS = statement.executeQuery();
%>
<table BORDER WIDTH="100%" >
<tr>
<td><b>First Name</b></td>
<td><b>Surname</b></td>
<td><b>Address</b></td>
<td><b>Number</b></td>
<td><b>Email Address</b></td>
</tr>
<%
while(RS.next())
{
String EmailAddress = RS.getString("EmailAddress ");
%>
<tr>
<td><%=RS.getString("First Name") %></td>
<td><%=RS.getString("LastN ame") %></td>
<td><%=RS.getString("Addre ss") %></td>
<td><%=RS.getString("Phone Number") %></td>
<a href="mailto:<%=EmailAddre ss%>"><%=E mailAddres s%></a></t d>
</tr>
String sql = ""
+ " SELECT FirstName, LastName, Address, PhoneNumber, EmailAddress "
+ " FROM Employee"
+ " WHERE FirstName = '" + request.getParameter("Firs
+ " AND LastName = '" + request.getParameter("Last
java.sql.PreparedStatement
ResultSet RS = statement.executeQuery();
%>
<table BORDER WIDTH="100%" >
<tr>
<td><b>First Name</b></td>
<td><b>Surname</b></td>
<td><b>Address</b></td>
<td><b>Number</b></td>
<td><b>Email Address</b></td>
</tr>
<%
while(RS.next())
{
String EmailAddress = RS.getString("EmailAddress
%>
<tr>
<td><%=RS.getString("First
<td><%=RS.getString("LastN
<td><%=RS.getString("Addre
<td><%=RS.getString("Phone
<a href="mailto:<%=EmailAddre
</tr>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
I was looking at the wrong tag the whole time, thinking to myself what is "cheekyci" going on about!!! But it was my mistake, so thanxxxx
I'll post some more problems later ;)
I was looking at the wrong tag the whole time, thinking to myself what is "cheekyci" going on about!!! But it was my mistake, so thanxxxx
I'll post some more problems later ;)
glad I could help and thanx for the "A"
CJ
CJ
Now if the user has Outlook configured as their default email program it will be launched otherwise their default email prog will be launched.
<%
Connection conn = null;
// .. setup conn here
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select email_address_column from your_table");
while(rs.next()) { %>
<a href="mailto:<%=rs.getStri
<% } %>
<%
rs.close();
stmt.close();
conn.close();
%>
CJ