CDO And MS Access

M

Masterblue

Hi, Right know im teaching myself a little about CDONTS . But know I want to
sent data form a database with a form.

I wou ld like to do the following:
- I have made a page with set of records.
- If you click on one of the records for more details you will go to a page
with details.
- Then when you like the details and you think that someone else would like
to see them to you will do the following: add your name, your emailaddress
and some comment.(see code below) In the form there are some hidden fields,
with the neccesary data from the database.

The problem is that when i sent the form, with CDONTS, you will not see the
hidden fields but only the other field which you see on the page.

Please help! :(


Thanx for your time!

bellow the code: ( 2 pages)
====================================================
The page with the form:
====================================================

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../../Connections/wonen.asp" -->
<%
Dim ContactEig__MMColParam
ContactEig__MMColParam = "1"
If (Request.QueryString("WoningID") <> "") Then
ContactEig__MMColParam = Request.QueryString("WoningID")
End If
%>
<%
Dim ContactEig
Dim ContactEig_numRows

Set ContactEig = Server.CreateObject("ADODB.Recordset")
ContactEig.ActiveConnection = MM_wonen_STRING
ContactEig.Source = "SELECT WoningID, WPlaats, WStraat, WNummer, WPostcodeC,
WPostcodeL, WVraagP, WContactMail FROM Omschrijving WHERE WoningID = " +
Replace(ContactEig__MMColParam, "'", "''") + ""
ContactEig.CursorType = 0
ContactEig.CursorLocation = 2
ContactEig.LockType = 1
ContactEig.Open()

ContactEig_numRows = 0
%>
<html><!-- InstanceBegin template="/Templates/221003.dwt.asp"
codeOutsideHTMLIsLocked="false" -->
<head>

<!-- InstanceBeginEditable name="doctitle" -->

<title>Woningen gratis plaatsen - koopwoningen, huizen, koopwoningen,
onroerend goed</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../../cssstyle/woningen.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" -->

<!-- InstanceEndEditable -->
</head>
<body>
<table width="750" height="400" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td valign="top">
<table width="100%" height="100%" border="0" cellpadding="2"
cellspacing="0">
<tr>
<td height="50" valign="top"><img
src="../../images/site/topwoningen.gif" width="750" height="50"></td>
</tr>
<tr>
<td height="1" valign="top" class="lineh"><img
src="../../images/trans.gif" width="100%" height="1"></td>
</tr>
<tr>
<td height="10" valign="top" span class="tekst"> <table
width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<!--#include file="../../inc/menu.inc.asp" -->
</td>
<td width="15%">
<div align="center"><a href="../contact.asp"><img
src="../../images/icons/mail.gif" alt="Neem contact op" width="16"
height="16" border="0"></a>&nbsp;<a href="#" onClick="window.print();return
false"><img src="../../images/icons/printer.gif" alt="Print" width="20"
height="20" border="0"></a></div></td>
</tr>
</table>

</td>
</tr>
<tr>
<td height="1" valign="top" class="lineh"><img
src="../../images/trans.gif"></td>
</tr>
<tr>
<td height="10" valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top" class="tekst"><!-- InstanceBeginEditable
name="Tekst" -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" valign="top" class="tekst">Hier kunt u een
reactie
geven op de betreffende woning. </td>
</tr>
<tr>
<td colspan="2" valign="top">&nbsp;</td>
</tr>
<tr>
<td colspan="2" valign="top">
<form name="form1" method="GET" action="ConEigWon_Send.asp">
<table width="100%" border="0" cellspacing="0"
cellpadding="2">
<tr>
<td class="tekst">Wat is uw naam? (incl.
achternaam)</td>
<td class="tekst">&nbsp;</td>
</tr>
<tr>
<td class="tekst"><input name="varNaam" type="text"
class="tekst" id="varNaam" size="32" maxlength="200"></td>
<td class="tekst">&nbsp;</td>
</tr>
<tr>
<td width="28%" class="tekst">Wat is uw
emailadres?</td>
<td width="72%" class="tekst">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><input name="varEmailFrom"
type="text" class="tekst" id="varEmailFrom" size="32" maxlength="200">
</td>
</tr>
<tr>
<td class="tekst">Uw reactie op deze woning</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2"> <textarea name="varReactieWoning"
cols="35" rows="5" wrap="VIRTUAL" class="tekst"></textarea></td>
</tr>
<tr>
<td>

<input type="hidden" value="<%=(ContactEig.Fields.Item("WoningID").Value)%>"
name="varWoningID">
<input type="hidden"
value="<%=(ContactEig.Fields.Item("WContactMail").Value)%>"
name="varContactEmail">
<input type="hidden" value="<%=(ContactEig.Fields.Item("WStraat").Value)%>"
name="varStraat">
<input type="hidden" value="<%=(ContactEig.Fields.Item("WNummer").Value)%>"
name="varNr">
<input type="hidden"
value="<%=(ContactEig.Fields.Item("WPostcodeC").Value)%>"
name="varPostcodeC">
<input type="hidden"
value="<%=(ContactEig.Fields.Item("WPostcodeL").Value)%>"
name="varPostcodeL">
<input type="hidden" value="<%=(ContactEig.Fields.Item("WPlaats").Value)%>"
name="varPlaats">
<input type="hidden" value="<%=(ContactEig.Fields.Item("WVraagP").Value)%>"
name="VarPrijs">


</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type='submit' class="knop"
value="Verzenden"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
</tr>
<tr>
<td height="1" valign="top" class="lineh"><img
src="../../images/trans.gif" width="100%" height="1"></td>
</tr>
<tr>

<td height="20" valign="top" class="tekst"> <img
src="../../images/icoon.gif" hspace="2" vspace="2" align="absmiddle">
2003 <a >Meer info</a></td>
</tr>
</table>
</td>
</tr>

</table>
</body>
<!-- InstanceEnd --></html>
<%
ContactEig.Close()
Set ContactEig = Nothing
%>

====================================================
The page that will send the email:
====================================================
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>



<html><!-- InstanceBegin template="/Templates/221003.dwt.asp"
codeOutsideHTMLIsLocked="false" -->
<head>

<!-- InstanceBeginEditable name="doctitle" -->

<title>Woningen gratis plaatsen - koopwoningen, huizen, koopwoningen,
onroerend goed</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../../cssstyle/woningen.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" -->

<!-- InstanceEndEditable -->
</head>
<body>
<table width="750" height="400" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td valign="top">
<table width="100%" height="100%" border="0" cellpadding="2"
cellspacing="0">
<tr>
<td height="50" valign="top"><img
src="../../images/site/topwoningen.gif" width="750" height="50"></td>
</tr>
<tr>
<td height="1" valign="top" class="lineh"><img
src="../../images/trans.gif" width="100%" height="1"></td>
</tr>
<tr>
<td height="10" valign="top" span class="tekst"> <table
width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<!--#include file="../../inc/menu.inc.asp" -->
</td>
<td width="15%">
<div align="center"><a href="../contact.asp"><img
src="../../images/icons/mail.gif" alt="Neem contact op" width="16"
height="16" border="0"></a>&nbsp;<a href="#" onClick="window.print();return
false"><img src="../../images/icons/printer.gif" alt="Print" width="20"
height="20" border="0"></a></div></td>
</tr>
</table>

</td>
</tr>
<tr>
<td height="1" valign="top" class="lineh"><img
src="../../images/trans.gif"></td>
</tr>
<tr>
<td height="10" valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top" class="tekst"><!-- InstanceBeginEditable
name="Tekst" -->


<%
' Begin CDO mail
Dim Naam
Dim MailVan
Dim Reactie
Dim MailAan
Dim WoningId
Dim StraatNaam
Dim StraatNr
Dim WPostcodeC
Dim WPostcodeL
Dim WPlaats
Dim VarPrijs

Dim objCDO


'formulierwaarden ophalen
Naam = Request.QueryString("varNaam") 'naam infovrager
MailVan = Request.QueryString("varEmailFrom") 'emailadres van infovrager
Reactie = Request.QueryString("varReactieWoning") 'reactie van de
infoaanvrager

MailAan = Request.QueryString("WContactMail") 'emailadres van
infoverlener
WoningId = Request.QueryString("WoningID") 'woningid van infoverlener
StraatNaam = Request.QueryString("WStraat") 'straatnaam object
StraatNr = Request.QueryString("WNummer") 'nr van object
PostcodeC = Request.QueryString("WPostcodeC") 'postcodecijfer van object
PostcodeL = Request.QueryString("WPostcodeL") 'postcodeletter van object
Plaats = Request.QueryString("WPlaats") 'plaats van object
Prijs = Request.QueryString("WVraagP") 'prijs van object


Set objCDO = Server.CreateObject("CDONTS.NewMail")



objCDO.From = MailVan

objCDO.To = MailAan

' objCDO.Cc = ""

objCDO.Bcc = "(e-mail address removed)"

objCDO.Subject = "Reactie op uw huis geplaats op
www.gratishuisplaatsen.nl"

'FORMULIER WAARDEN IN DE MAIL ZETTEN
objCDO.Body = "De volgende persoon vraagt meer informatie aan m.b.t. uw
object:" & vbCrLf & "Naam van informatieaanvrager: " & Naam & vbCrLf &
"Emailadres van de aanvrager: " & MailVan & vbCrLf & "De vraag is: " &
Reactie & vbCrLf & "Het gaat om de volgende woning: " & vbCrLf &
"Straatnaam: " & StraatNaam & " nr:" & StraatNr & vbCrLf & "Postcode: " &
PostcodeC & PostcodeL & vbCrLf & "Plaatsnaam: " & Plaats & vbCrLf &
"Vraagprijs: " & Prijs & vbCrLf & vbCrLf & vbCrLf & "De woning kunt u
bekijken op:" & vbCrLf &
"http://62.131.125.218/woningen/content/Detail.asp?WoningID=" & WoningID &
vbCrLf & vbCrLf & vbCrLf & "(kopieer en plak eventueel deze url in de
browser om naar de betreffende pagina te gaan)"

objCDO.BodyFormat = 1
objCDO.MailFormat = 1
objCDO.Send

' Einde CDO mail
%>

<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="tekstVet">Uw email is verzonden</td>
</tr>
<tr>
<td class="tekst">.</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>

</td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
</tr>
<tr>
<td height="1" valign="top" class="lineh"><img
src="../../images/trans.gif" width="100%" height="1"></td>
</tr>
<tr>

<td height="20" valign="top" class="tekst"> <img
src="../../images/icoon.gif" hspace="2" vspace="2" align="absmiddle">
2003 <a href="mailto:[email protected]">Meer info</a></td>
</tr>
</table>
</td>
</tr>

</table>
</body>
<!-- InstanceEnd --></html>
 

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

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top