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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emailing from results

Status
Not open for further replies.

stevemarsh99

Technical User
Aug 10, 2005
88
GB
Would it be possible to send an email on a date that is held in a database? I dont really understand Stored Proceedures too :p

I also have a huge list of links in a database that I need in a form of a box with the abcdefg____xyz as links at the top and when you click a letter it goes to all the 'A's

Thanks if you can help
 
Yes it is possible to send an email on a date in a database, unfortunately you are going to have to look into scheduling stored procedures do achieve this.

A regards the A-Z links list, just have a recordset that selects everything that matches a querystring variable. Set the default value of the variable to % and have each letter as an individual link to the same page but passing itself as the variable. Example for "A"
Code:
<a href="thispage.asp?letter=a">A</a>

Cheech

[Peace][Pipe]
 
Sorry to sound silly but what do you mean by the creating a recordset that selects everything that matches a variable?
 
Create a recordset, use the advanced view, add a variable with a default value of % and a runtime value of Request.Querystring("letter")

[Peace][Pipe]
 
Advanced mode? do you mean code view? (DWMX) and how do you 'add a variable with a default value of %'
 
No I mean add a recordset and use the advanced button to be able to see what is going on and add the variables.

Have you added a recordset to the page at all?
What language are you using? (ASP, CF, PHP)

[Peace][Pipe]
 
I am using ASP, and I have already created a recordset to display the current links that reside in the database?
 
can you post the code for your recordset

[Peace][Pipe]
 
<%
Dim rs_links
Dim rs_links_numRows

Set rs_links = Server.CreateObject("ADODB.Recordset")
rs_links.ActiveConnection = MM_KHLCONNECTION_STRING
rs_links.Source = "SELECT * FROM tbl_links"
rs_links.CursorType = 0
rs_links.CursorLocation = 2
rs_links.LockType = 1
rs_links.Open()

rs_links_numRows = 0
%>
 
No doesn't need to be in a form
Code:
<%
Dim rs_links__MMColParam
rs_links__MMColParam = "%"
If (Request.QueryString("letter") <> "") Then 
  rs_links__MMColParam = Request.QueryString("letter")
End If
%>
<%
Dim rs_links
Dim rs_links_numRows

Set rs_links = Server.CreateObject("ADODB.Recordset")
rs_links.ActiveConnection = MM_KHLCONNECTION_STRING
rs_links.Source = "SELECT * FROM tbl_links WHERE fldTitle = '" + Replace(rs_links__MMColParam, "'", "''") + "%'"
rs_links.CursorType = 0
rs_links.CursorLocation = 2
rs_links.LockType = 1
rs_links.Open()

rs_links_numRows = 0
%>

You will see that there is 2 pieces of asp code, the first declares the variable that you wish to filter on. Thi sis initially set to "%" to select everything. If you then have href links to the same page along the lines of
Code:
<a href="mypage.asp?letter=a">A</a>
When a link is clicked the rs will only select the records that begin with the relevant letter

[Peace][Pipe]
 
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
Links/default.asp, line 21


Do I need to put the binding of Request, then querystring equaling 'letter' to the same page and if so where?
 
yes you need to put both bits of code into your page. One after the other as above.

[Peace][Pipe]
 
Right I have it on the page but when i paste that code over the old recordset, in dreamweaver, next to the recordset it has the red explaination mark? Does this mean there is a problem with the recordset on the page even though it displays ok?

I have the code at the top of the page

I have the link at the bottom of the page (in the body)

But then I click the link nothing happens. When I display the page it does not show the contents of the recordset and I dont understand where in that code you are filtering for strings of characters?

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top