PDA

View Full Version : getting area href to work


gcapp
09-09-2002, 03:23 PM
If someone can help me with this I would appreciate it.

I have this code on my page:

<%Session("GotFlash") = true%>

<%
PageHeader = "Enchanted Mountains Region - County Map"
%>
<!-- #include file=inc_header.asp -->

<table border="0" width="500">
<tr>
<td><font face="Arial"><b><u>Enchanted Mountains Interactive Map</u></b></font>
<p><font face="Arial" size="2">The Enchanted Mountains *NEW* interactive
map allows you to view specific areas that your are searching for.&nbsp;
It also provides detailed listings of outdoor places of interest.</font></p>
<p><font face="Arial" size="2">To access out new map, simply click on the <b><font color="#FF0000">red
portion</font></b> on the locator map below.</font></p>
<p><map name="FPMap0">
<area href="javascript:void(0)" onclick="window.open('http://www.cattco.org/maps-photos/Maps/county_map.shtml', 'winMenu', 'width=600,height=400,location=1,menubar=1,resizable=1,scrollbars=1,status=1,toolbar=1')" shape="rect" coords="195, 163, 226, 189"></map><img border="0" src="images/locator-map.gif" width="461" height="370" usemap="#FPMap0"></td>
</tr>
</table>


But when I click on the area where the hyperlink should be, I get nothing. Can someone explain why??

Thanks,
Gary

Morgoth
09-09-2002, 04:00 PM
Is this not an HTML question??
You might have better luck in the html forums.

gcapp
09-09-2002, 04:12 PM
Morgoth,
Well I posted it here because this code works on all my html pages and when I put it in my asp page it doesn't work. I figure it must have something to do with asp. So if there is an answer here I hope to find it.

Gary

Morgoth
09-09-2002, 05:11 PM
Ok I found it out.

Or, I think I did.


<table border="0" width="500">
<tr>
<td>
<font face="Arial"><b><u>Enchanted Mountains Interactive Map</u></b></font>
<p>
<font face="Arial" size="2">The Enchanted Mountains *NEW* interactive map allows you to view specific areas that your are searching for. It also provides detailed listings of outdoor places of interest.</font>
</p>
<p>
<font face="Arial" size="2">To access out new map, simply click on the <b><font color="#FF0000">red portion</font></b> on the locator map below.</font>
</p>
<p>
<map name="FPMap0">
<area href="javascript://" shape="rect" coords="195, 163, 226, 189" onclick="window.open('http://www.cattco.org/maps-photos/Maps/county_map.shtml','winMenu','width=600,height=400,location=1,menubar=1,resizable=1,scrollbars=1,stat us=1,toolbar=1')" >
</map>
<img border="0" src="picture.bmp" width="461" height="370" usemap="#FPMap0">
</td>
</tr>
</table>



I changes the image to picture.bmp so i could see the LITTLE red rectangle

I also chnaged the "javascript:void(0)" line to javascript://
I figured void ment that you didn't want it to link to anything.

Now, this html code works for me, without any problems.
Try the javascript:// thing and see if it works, if not, then I might need more ASP code to view.

gcapp
09-09-2002, 08:31 PM
Morgoth,
No it still will not work. Here is the actual page I'm trying to get to work:

Map Page (http://www.enchantedmountains.org/asp/county-map.asp)

I want it so when people click on the red area of the map, they are taken to another site in a separate window.

The entire code for the page is here:

<%Session("GotFlash") = true%>

<%
PageHeader = "Enchanted Mountains Region - County Map"
%>
<!-- #include file=inc_header.asp -->

<table border="0" width="500">
<tr>
<td><font face="Arial"><b><u>Enchanted Mountains Interactive Map</u></b></font>
<p><font face="Arial" size="2">The Enchanted Mountains *NEW* interactive
map allows you to view specific areas that your are searching for.&nbsp;
It also provides detailed listings of outdoor places of interest.</font></p>
<p><font face="Arial" size="2">To access out new map, simply click on the <b><font color="#FF0000">red
portion</font></b> on the locator map below.</font></p>
<p><map name="FPMap0">
<area href="javascript:void(0)" onclick="window.open('http://www.cattco.org/maps-photos/Maps/county_map.shtml', 'winMenu', 'width=600,height=400,location=1,menubar=1,resizable=1,scrollbars=1,status=1,toolbar=1')" shape="rect" coords="197, 164, 225, 190"></map><img border="0" src="images/locator-map.gif" usemap="#FPMap0"></p>
</td>
</tr>
</table>


Now if I preview this in Front Page it works. Somehow the code is not getting passed through the asp pages. I'm a rookie,so I don't know.

If you can help, it would be appreciated.

Gary

Morgoth
09-10-2002, 12:45 AM
Hehehehe I found it..
It has ot be this, cause It worked as soon as I did it.

Change <map name="FPMap0"> and usemap="#FPMap0" to <map name="K"> and usemap="#K"

This will work.
Go ahead and try it.
It must be the number in there.

Morgoth
09-10-2002, 12:46 AM
By the way, that page you are showing me, doesn' t have a title.
You might want to add that in before you forget :)

gcapp
09-10-2002, 01:59 PM
Morgoth,
Hey your advice worked. Thanks so much.
That is one minor problem solved - I'm sure you will see more posts from me (probably today). I have some other issues that are giving me problems.

Gary

Morgoth
09-10-2002, 02:32 PM
NP, I like to help.

gcapp
09-10-2002, 05:57 PM
Morgoth,
Ok here I am with another problem. Maybe you can help me with this.

If you go to this link
Contact Form (http://www.enchantedmountains.org/asp/contact_us.asp)

you will see a contact form to be filled out. However there is a problem with it and if you check the source code, I'm sure you will find it.

The problem is with the check boxes. This form worked prior to my adding the check boxes. I'm new to asp, so I tried to add the check boxes in the code and it's wrong because if you check a checkbox, and try to send it, it will ask you to put something into that box which obviously you can't.

All I am simply trying to do is have somebody check whatever boxes they want and then the information will be sent via email to me and the information will also go directly into my Access database.

I'm sure this error is because I named the checkboxes txt, but i'm not quite sure how to correct it. I have a book I'm trying to follow, but I can't find exactly what I need.

If you can help, I would appreciate it.

Gary

Morgoth
09-10-2002, 06:10 PM
Ok let me see.

In your access database, you need ot have a field designed for a yes/no question as the data type.

When you go into design view into your access database table, you will need ot set the datatype to yes/no and set a default value. Set the default value of False. This means if the field is not told other wise, it will be fasle, and that measn the check box isn't set to True or it isn't checked.

If this doesn't hlep, I might need to view the ASP code, it could be a problem with you trying to send a value that isn't there.

gcapp
09-10-2002, 08:17 PM
Morgoth,
I am getting the exact same thing to happen. Whatever check box you check, it will ask you to input data into it.

I have attached the code for the page. There are a lot of checkboxes. What I did for your readablilty is put the code that I added between dashed lines.

I also, obviously added the fields in the form, which I did not use dashed lines around in the code.

I changed the database and have all the checkbox fields at yes/no with a default of no.

Like I said, I get the feeling that I shouldn't have the checkboxes the same as the text fields.

If you can help it would be appreciated.

gary

Morgoth
09-10-2002, 11:10 PM
Ok, well first off, your going REALLY hardcore with all this code here.

Check for mistakes:
txtFourorMore = Request("FororMore")

Now for the checkboxes(Your code is messy):
You will need to send a true or false message, or else there is no point adding it to a db.
If Request("Summer") = "Yes" Then
txtSummer = True
Else
txtSummer = False
End If

Now you probibly don't need to chnage your AQL statments if you add this code for all your check boxes.
Inside of your DB change the format to True/False, set default back to nothing, cause you tell it to add either True or false, before you were sending it Empty strings and it hates you when you spam it with stuff it doesn't like(nothing). :)
So.

Try this.
If I am wrong, I am going to have to look through yuor code more.

gcapp
09-11-2002, 01:38 PM
Morgoth,
Well I made the changes that you wanted and it still isn't working. In fact, now I get an error "Unterminated string constant".

I changed the database for the checkbox fields and made them True/False with no default.

As before, I have attached the page with the changes that you wanted me to do. Again, the code I added is in between the dashed lines. This code worked fine before I added the checkboxes, so I don't know what I did wrong.

If you can help me it would be appreciated.

gary

Morgoth
09-11-2002, 02:17 PM
Do me a favour, and remove all the code from the file that has nothing to do with the checkboxes, I don't want to get confused.
(I am at school right now, and unable to download the file. I can view it if you paste the code in, or give a direct link from another server)

I don't know what could be the problem until I re look over your SQL statments, I wont be able to downlaod the file until I get home around 2:00pm, or until you post up the code.

gcapp
09-11-2002, 03:16 PM
Morgoth,
Ok I pulled out all the code that isn't involved with the checkboxes. I basically cut it down so it would fit here. Instead of putting all the code for each checkbox, I just put a few. I did follow the same format for all checkboxes. If you think there is an important line missing, I may have not put it here.

If this code is too hard to follow then go to this link:
Contact Form (http://www.enchantedmountains.org/asp/contact_us.asp) and grab the code from the source.

Thanks for the help.
Gary


' Read in the checkbox values
txtAlleganyStatePark = Request("AlleganyStatePark")
txtAmish = Request("Amish")
txtAntiquesShopping = Request("AntiquesShopping")





'Validate all check boxes in interests
If Request("AlleganyStatePark") = "Yes" then
txtAlleganyStatePark = True
Else
txtAlleganyStatePark = False
End If
If Request("Amish") = "Yes" then
txtAmish = True
Else
txtAmish = False
End If
If Request("AntiquesShopping") = "Yes" then
txtAntiquesShopping = True
Else
txtAntiquesShopping = False
End If









SQL = SQL & "AlleganyStatePark = " & CheckString(txtAlleganyStatePark,",") & " "
SQL = SQL & "Amish = " & CheckString(txtAmish,",") & " "
SQL = SQL & "AntiquesShopping = " & CheckString(txtAntiquesShopping,",") & " "






Mailer.BodyText = " "
Mailer.BodyText = "Interests: " & txtAlleganyStatePark & strAmish & txtAntiquesShopping _
& txtBikingHiking & txtCanoeBoating & txtDining & txtGolf _
& txtHuntingFishing & txtOutdoorsScenery & txtRockCityPark _
& txtSenecaPowWow & txtSkiing & txtSnowmobile
Mailer.BodyText = " "
Mailer.BodyText = "Will be visiting: " & txtSpring & txtSummer & txtFall & txtWinter
Mailer.BodyText = " "
Mailer.BodyText = "My stay will be: " & txtOneThree & txtFourorMore & txtDayTrip
Mailer.BodyText = " "
Mailer.BodyText = "Reason for visit: " & txtVacation & txtBusiness & txtFamilyFriends
Mailer.BodyText = " "
Mailer.BodyText = "I will be staying: " & txtHotelMotel & txtCabin & txtBedandBreakfast _
& txtCamping & txtFriendsFamily & txtCottageCondo
Mailer.BodyText = " "
Mailer.BodyText = "Last visited region: " & txtLastVisited
-----------------------------------------------------------------------------------------------
Mailer.SendMail

End If


'If user's first contact
Else

'Insert into database
SQL = "INSERT INTO Visitors (" &_


-------------------------------------------------------
' I ADDED THESE LINES

"AlleganyStatePark, " &_
"Amish, " &_
"AntiquesShopping, " &_
"BikingHiking, " &_
"CanoeBoating, " &_
"Dining, " &_
"Golf, " &_
"HuntingFishing, " &_
"OutdoorsScenery, " &_
"RockCityPark, " &_
"SenecaPowWow, " &_
"Skiing, " &_
"Snowmobile, " &_
"Spring, " &_
"Summer, " &_
"Fall, " &_
"Winter, " &_
"OneThree, " &_
"FourorMore, " &_
"DayTrip, " &_
"Vacation, " &_
"Business, " &_
"FamilyFriends, " &_
"HotelMotel, " &_
"Cabin, " &_
"BedandBreakfast, " &_
"Camping, " &_
"FriendsFamily, " &_
"CottageCondo, " &_
---------------------------------------------
"LastVisited, " &_
"FirstContact) " &_
"ActivateSend, " &_
"VALUES ( "

---------------------------------------------------------------------

SQL = SQL & CheckString(txtAlleganyStatePark,",")
SQL = SQL & CheckString(txtAmish,",")
SQL = SQL & CheckString(txtAntiquesShopping,",")








Mailer.BodyText = " "
Mailer.BodyText = "Interests: " & txtAlleganyStatePark & strAmish & txtAntiquesShopping _
& txtBikingHiking & txtCanoeBoating & txtDining & txtGolf _
& txtHuntingFishing & txtOutdoorsScenery & txtRockCityPark _
& txtSenecaPowWow & txtSkiing & txtSnowmobile
Mailer.BodyText = " "
Mailer.BodyText = "Will be visiting: " & txtSpring & txtSummer & txtFall & txtWinter
Mailer.BodyText = " "
Mailer.BodyText = "My stay will be: " & txtOneThree & txtFourorMore & txtDayTrip
Mailer.BodyText = " "
Mailer.BodyText = "Reason for visit: " & txtVacation & txtBusiness & txtFamilyFriends
Mailer.BodyText = " "
Mailer.BodyText = "I will be staying: " & txtHotelMotel & txtCabin & txtBedandBreakfast _
& txtCamping & txtFriendsFamily & txtCottageCondo
Mailer.BodyText = " "
Mailer.BodyText = "Last visited region: " & txtLastVisited

--------------------------------------------------------------------------------------------------
Mailer.SendMail

End If




<td valign="top" align="left" width="439">
<table border="0" width="100%">
<tr>
<td width="33%"><font size="1" face="Arial"><input type="checkbox" name="Allegany State Park" value="Yes">Allegany
State Park</font></td>
<td width="33%"><font size="1" face="Arial"><input type="checkbox" name="Amish" value="Yes">Amish</font></td>
<td width="33%" colspan="2"><font size="1" face="Arial"><input type="checkbox" name="AntiquesShopping" value="Yes">Antiques/Shopping</font></td>
</tr>

<td width="25%"><font face="Arial" size="1"><input type="checkbox" name="Skiing" value="Yes">Skiing</font></td>
<td width="25%"><font face="Arial" size="1"><input type="checkbox" name="Snowmobile" value="Yes">Snowmobile</font></td>
</tr>
</table>
</td>


</tr>

<tr>

<td valign="top" align="left" colspan="2" width="725"><font size="2" face="Arial">&nbsp;</font></td>

</tr>

<tr>

<td valign="top" align="left" width="280"><font size="2" face="Arial">When
will you be visiting:</font></td>

<td valign="top" align="left" width="439">
<table border="0" width="100%">
<tr>
<td width="25%"><font size="1" face="Arial"><input type="checkbox" name="Spring" value="Yes">Spring</font></td>
<td width="25%"><font size="1" face="Arial"><input type="checkbox" name="Summer" value="Yes">Summer</font></td>
<td width="25%"><font size="1" face="Arial"><input type="checkbox" name="Fall" value="Yes">Fall</font></td>
<td width="25%"><font size="1" face="Arial"><input type="checkbox" name="Winter" value="Yes">Winter</font></td>
</tr>
</table>
</td>

</tr>

<tr>

<td valign="top" align="left" width="280"><font size="2" face="Arial">How
long will you be staying:</font></td>

<td valign="top" align="left" width="439">
<table border="0" width="100%">
<tr>
<td width="25%"><font face="Arial" size="1"><input type="checkbox" name="OneThree" value="Yes">1-3
Days</font></td>
<td width="25%"><font face="Arial" size="1"><input type="checkbox" name="FourorMore" value="Yes">4-7+
Days</font></td>
<td width="25%"><font face="Arial" size="1"><input type="checkbox" name="DayTrip" value="Yes">Day
Trip</font></td>
<td width="25%"></td>
</tr>
</table>
</td>

</tr>

<tr>

<td valign="top" align="left" width="280"><font size="2" face="Arial">Reason
for visit:</font></td>

<td valign="top" align="left" width="439">
<table border="0" width="100%">
<tr>
<td width="25%"><font face="Arial" size="1"><input type="checkbox" name="Vacation" value="Yes">Vacation</font></td>
<td width="25%"><font face="Arial" size="1"><input type="checkbox" name="Business" value="Yes">Business</font></td>
<td width="25%"><font face="Arial" size="1"><input type="checkbox" name="FamilyFriends" value="Yes">Family/Friends</font></td>
<td width="25%"></td>
</tr>
</table>
</td>

</tr>



</table>
</td>

Morgoth
09-11-2002, 03:54 PM
Ok, I am not sure exactly why you have a few things in here.

What are you doing with your SQL statments?
SQL = SQL & "AlleganyStatePark = " & CheckString(txtAlleganyStatePark,",") & " "
SQL = SQL & "Amish = " & CheckString(txtAmish,",") & " "
SQL = SQL & "AntiquesShopping = " & CheckString(txtAntiquesShopping,",") & " "

You need to write out your SQL staments so that they say where you want to add your info.

SQL="INSERT INTO Amish (" & txtAmish & ")"

Maybe you didn't add this line to the text you gave me, I'd like to see what you did, if you made it.

Inserting True or False into the db is the same as inserting a string. Same Method.

Morgoth
09-11-2002, 04:00 PM
I'll tell you what. If I don't help you with this script by telling you how to do it. It would most likely be my fault.

What I will do for you is write out the entire script for you, for all strings and for all checkboxes.

I will give it to you, and you can change it all you want. I think I am getting very confused because of the amount of code and how un orderly it is.

In the oast few months, I found out how good it is to indent and make code look nice.
It doesn't just make it easier to read, if you have alot of code, it will help you in size. Sending less KB over the inter net.

So If I can't find out how to help you by tonight, I will re write everything and show you exactly what Idid to get it to work, and you will be bale to find out why I couldn't help you before.

BTW, you have a really nice website.

gcapp
09-11-2002, 04:22 PM
Morgoth,
Thanks so much for your help.

The reason you see any code on my pages is because the original code that worked was given to me by another person. That code worked perfect. So I needed to add checkboxes to my form, so I kind of copied the way the original was layed out. After I changed the code, the form almost worked except that whatever checkbox you checked, it then asked you to input data into that checkbox. I knew at that point that I made the checkboxes - textboxes, so that is when I got stuck.

If you do write up the whole code for me you can just put in one text box and a few checkboxes. I can then copy the code you write to add the rest of the text and checkboxes.

What I am simply trying to do is have each text box and checkbox populate a field in my Access database and then send an email to me.

Like I said before, there will be a section that asks "When will you visit?" The checkboxes will be Spring, Summer, Fall and Winter. Each of the checkboxes will be a separate field in my database. I need it that way so at the end of the year, I can tally up and see how many people picked only, say Winter.

Seems simple in my head, but getting it from my brain to code has been tough. If I make any progress today, I'll post back to you again.

Gary

Morgoth
09-11-2002, 05:17 PM
Ok, I'll write out exactly the pieces of code and how ot do it for you, so that you can copy and paste it in to your code and change the text and add more.

Do you have any need for radio buttons? So that people can only pick one, over the other?

For this winter, spring, etc... I can add acounter so that instead of number of true or false answers for each one, it will be a 1 so that at the end, you can add up all the 1s and find out exactly how many votes for winter, spring, etc... by the end of the year.

(Please excuse any double or tripple spacing, the key board I am using at this school are really bad and the space bar is very sticky and old.)

gcapp
09-11-2002, 05:50 PM
Morgoth,
The number counter thing sounds great. As far as radio buttons, yes I have a need for one section. The section is "How long will you be staying?" and the button would be 1-3 Days, 4 or More Days and Day Trip.

I really appreciate what you're doing. If it wasn't for people like yourself, us beginners would never get off the ground.

After you send the code, if I have any questions I will ask.

I'm actually trying something different with my contact form nw but I don't know if it will work. But it's the only way I will learn.

Thanks again!
Gary

Morgoth
09-11-2002, 07:26 PM
:D
I just wish I got more help then I did when I was starting. Acually, I am trying to more people by opening my computer up for free hosting. Soon... but I am afraid if it doesn't help people, and only causes problems.

I am only trying to offer people something I didn't get when I started ASP.

The free service is only for personal sites and stuff like that, I don't want people comming up to me and asking me to host a site that could bring in the wrong types of people. I will not accept stuff like that.

I am home right now, and I am going to get started on the scripts. I will include a DB with it so you can see why I named stuff what or so it runs if you just test it. :)

Morgoth
09-11-2002, 11:52 PM
Well, I got this done, take a look.

gcapp
09-12-2002, 01:37 PM
I got you zip file this morning. I'm going to look at it now and i"ll let you know what happens.

Thanks,
gary

gcapp
09-12-2002, 05:31 PM
Well I am having problems right off with the script you sent.

I attached the changes I made to your script.

I can tell you on line 5 I get an error that says "expected identifier". So I dont' know.

I substituted my textboxes and checkboxes for yours.

The only other thing I did was change the connection string to a dsn connection that I know works.

Maybe you can figure out what is with the error.

Gary

Morgoth
09-12-2002, 07:49 PM
You messed up big.

The value for all the check boxes has to be "Yes" and yet you have them all "1".

Now, to make sure you know what I did, was that you wanted to add up all the votes for WINTER, FALL, SPRING, and SUMMER ONLY!
So get rid of:
If Request.Form("Winter") = "Yes" Then
StrWinter = True
Else
StrWinter = False
End If

for winter, fall, spring, and summer.
Now, inside the db, IF YOU LOOk, you can see what is differnt.

Your textbox's should be like the textbox field
Your radio's should be like the radio field
Your checkbox's should be like the checkbox field
And
for winter, fall, etc.. it should be the same as mine, cause your adding up the 1s int he end so you see them int he e-mail.

So you understand?

Morgoth
09-12-2002, 07:50 PM
Selecting the SUM is only for the winter, fall, etc aswell.

I thought i made it clear, there there is another checkbox in there, and it is for everyone BUT the winter, fall etc...

gcapp
09-13-2002, 12:56 AM
Ok, I just got back from work and I haven't changed anything in my code as of yet.

I wanted to make sure that what I wanted in this form is what you did in the code.

What I want to do is to have every check box that I put on this form, have it's own field in the database. And have every check box have a number value go into the database, so at the end of the year I can count up how many people checked Amish or Spring or Day Trip or any of the check boxes.

So all checkboxes should have a number go into the database.

You don't have to put any code in there for totaling each checkbox. That can be done via query in access. I'm not worried about that.

So let me know what I should change in the code that I sent you to have it the way I described.

Thanks,
Gary

Morgoth
09-13-2002, 01:33 AM
Ok.. you want every check box with a number value.
If so, Remove ALL of the:
If Blah="yes" then Blah=true end BLAH

You don't need that stuff.


Now, this is a problem that I SUFFERED with when making this code cause I am a charater mistake kind of guy.

When you add a string and a number to a db with the line of code i gave you, it's going to be a little wierd.
Look:
VALUES ('" & STRING & "'," & NUMBER & ")
See it?
For the string, you have to Quote it still, and the number doesn't need quotes. So a string is:
VALUES ('" & STRING & "'," & NUMBER & ")

It will help if you do this, cause you wont get an error later as tear off your eye brow, like I did. :) It's fine, I put some dirt there, looks fine. lol.

Do you know what a string prefix is and a number prefix?
StrNAME - words - String
IntAGE - number - Integer

So, not that it matters, but for neatness you should have your strings with Str and your numbers with Int. Not all of them are Strings.
Your checkboxs are sending a value of one now. :)


Now, when you "SELECT sum" it will only be for the numbers and only for checkboxes, cause your counting down the entire field for each one. and you can;t count words :)

"Response.Redirect" is what i used so that istead of a guy returning ot the same page and being able to hit refresh and send the data AGAIN, it will make sure it you can't hit refresh.
So you DON'T NEED "?IT=WORKED" at the end of it. :)

and as for your error, I think you got it cause you didn't DIM a veriable.

Option Explicit (at the top of your file) will make sure all your veriables are defined and if it isn't defined and you just added it in there, you need ot go and add it.
So your string "DOWNLOAD_DSN" must be defined at the top, add it in.
Dim DOWNLOAD_DSN, UPLOAD_DSN, SMTP_SERVER and any others it tells you too.

Any other problems... just reply!

gcapp
09-13-2002, 02:15 PM
Well I may be getting a little closer but there is still an error.

I went through and made all the changes you suggested.

However I have run into an "Unterminated string" error on this line:

<%dlSQL = "INSERT INTO Visitors (FirstName, LastName, Organization, Address, _ etc, etc,


I'm not sure what the error is. I figured out the first error was because I didn't have the "underscore" "_" at the end of lines of long code that carried over to the next line.

I attached my asp page again.

Maybe I'll find the error before you see it.

Thanks,
Gary

gcapp
09-13-2002, 04:56 PM
Just to let you know I have been looking and looking at this and can't find where the error is in the code. If you find something, please let me know.

Gary

gcapp
09-13-2002, 10:14 PM
Alex,
Well I've tried and tried to get this thing working. I changed afew things and finally got the form page to show, but when I enter info into it, I get and error that puzzles me.

The error is a type mismatch error and is on this line:
<%
IntAlleganyStatePark = dloRS("IntAlleganyStatePark")
IntAmish = dloRS("IntAmish")
IntAntiquesShopping = dloRS("IntAntiquesShopping")
etc, etc.

I've tried several different ways to get this thing to work and i still can't.

I attached the latest page with the changes I made.

If I make any other progress or you come up with anything, PLEASE let me know.

Gary

Morgoth
09-13-2002, 10:43 PM
Well, I think the problem is because:
Code1

<%
IntAlleganyStatePark = dloRS("IntAlleganyStatePark")
IntAmish = dloRS("IntAmish")
IntAntiquesShopping = dloRS("IntAntiquesShopping")
Etc...

Must be after:
Code2

dlSQL = "SELECT sum(AlleganyStatePark) AS IntAlleganyStatePark, sum(Amish) AS IntAmish, sum(AntiquesShopping) AS IntAntiquesShopping, Etc...


Now, because Code2 takes the numbers, adds them up, and sticks them under IntSomething by executing this code, you need to put that number in a integer to use, Code1.

You see?
Order matters

Morgoth
09-13-2002, 10:44 PM
Your server (and mine) executes code line by line, not by jumping around the page to find out info. :)

gcapp
09-14-2002, 01:39 PM
Alex,
Well I changed what you told me and now I have another syntax error. Arghhhhhhhhhh!!!

The error occurs somwhere in here:

<%dlSQL = "INSERT INTO Visitors (FirstName, LastName, Organization, Address, "& _
"City, State, Zip, CanZip, Country, Phone, eMail, WebsiteInfo,"& _
"LastVisited, AlleganyStatePark, Amish, AntiquesShopping, BikingHiking, CanoeBoating,"& _
"Dining, Golf, HuntingFishing, OutdoorScenery, RockCityPark, SenecaPowWow,"& _
"Skiing, Snowmobile, Spring, Summer, Fall, Winter, OneThree, FourorMore,"& _
"DayTrip, Vacation, Business, FamilyFriends, HotelMotel, Cabin, BedandBreakfast,"& _
"Camping, FriendsFamily, CottageCondo)"& _
"VALUES (('" & StrFirstName & "'),('" & StrLastName & "'),('" & StrOrganization & "'),('" & StrAddress & "'),"& _
"('" & StrCity & "'),('" & StrState & "'),('" & StrZip & "'),('" & StrCanZip & "'),('" & StrCountry & "'),('" & StrPhone & "'),('" & StreMail & "'),('" & StrWebsiteInfo & "'), "& _
"('" & StrLastVisited & "'),(" & IntAlleganyStatePark & "),(" & IntAmish & "),(" & IntAntiquesShopping & "),(" & IntBikingHiking & "),(" & IntCanoeBoating & "),"& _
"(" & IntDining & "),(" & IntGolf & "),(" & IntHuntingFishing & "),(" & IntOutdoorScenery & "),(" & IntRockCityPark & "),(" & IntSenecaPowWow & "),"& _
"(" & IntSkiing & "),(" & IntSnowmobile & "),(" & IntSpring & "),(" & IntSummer & "),(" & IntFall & "),(" & IntWinter & "),(" & IntOneThree & "),(" & IntFourorMore & "),"& _
"(" & IntDayTrip & "),(" & IntVacation & "),(" & IntBusiness & "),(" & IntFamilyFriends & "),(" & IntHotelMotel & "),(" & IntCabin & "),(" & IntBedandBreakfast & "), "& _
"(" & IntCamping & "),(" & IntFriendsFamily & "),(" & IntCottageCondo & "))"
Set dloRS = Conn.Execute(dlSQL)
%>

The error states that the error occurs on line 351, which is the Set dloRS = Conn.Execute(dlSQL) and it has '()' after it.

Can't figure this out either. I concatenated every line and put () around each string and an extra set around the whole set.

Believe me, if I ever get this to work, I am going to pay you back in some form or another.

Gary

Morgoth
09-15-2002, 05:07 PM
I will be right to this as soon as I install IIS to test it.
I just got my new 20gig hd, so I am happy that I have more room now. :)
I will get to this today. Hopfully.

Morgoth
09-16-2002, 05:22 AM
Sorry I was late on this, I got my 20 gig installed good, and I'm done with it now.

So let's get to your problem:

Originally posted by gcapp
"VALUES (('" & StrFirstName & "'),('" & StrLastName & "'),('" & StrOrganization & "'),('" & StrAddress & "') Etc..

I concatenated every line and put () around each string and an extra set around the whole set.


Well, why did you put '()'s around the strings in the first place?

Mine looks like:
VALUES ('" & StrString & "'," & IntNumber & " Etc...

I didn't have '()'s, why do you?

Remove them, then try it.

gcapp
09-16-2002, 01:30 PM
Alex,
I put the () aroudn them because I thought that since i had to concenate the lines, that the extra "" would screw up the lines.

Ok I removed the () and now I still get a syntax error in that area.

Here's the area again:
<%dlSQL = "INSERT INTO Visitors (FirstName, LastName, Organization, Address, "& _
"City, State, Zip, CanZip, Country, Phone, eMail, WebsiteInfo,"& _
"LastVisited, AlleganyStatePark, Amish, AntiquesShopping, BikingHiking, CanoeBoating,"& _
"Dining, Golf, HuntingFishing, OutdoorScenery, RockCityPark, SenecaPowWow,"& _
"Skiing, Snowmobile, Spring, Summer, Fall, Winter, OneThree, FourorMore,"& _
"DayTrip, Vacation, Business, FamilyFriends, HotelMotel, Cabin, BedandBreakfast,"& _
"Camping, FriendsFamily, CottageCondo)"& _
"VALUES '" & StrFirstName & "','" & StrLastName & "','" & StrOrganization & "','" & StrAddress & "',"& _
"'" & StrCity & "','" & StrState & "','" & StrZip & "','" & StrCanZip & "','" & StrCountry & "','" & StrPhone & "','" & StreMail & "','" & StrWebsiteInfo & "', "& _
"'" & StrLastVisited & "'," & IntAlleganyStatePark & "," & IntAmish & "," & IntAntiquesShopping & "," & IntBikingHiking & "," & IntCanoeBoating & ","& _
"" & IntDining & "," & IntGolf & "," & IntHuntingFishing & "," & IntOutdoorScenery & "," & IntRockCityPark & "," & IntSenecaPowWow & ","& _
"" & IntSkiing & "," & IntSnowmobile & "," & IntSpring & "," & IntSummer & "," & IntFall & "," & IntWinter & "," & IntOneThree & "," & IntFourorMore & ","& _
"" & IntDayTrip & "," & IntVacation & "," & IntBusiness & "," & IntFamilyFriends & "," & IntHotelMotel & "," & IntCabin & "," & IntBedandBreakfast & ", "& _
"" & IntCamping & "," & IntFriendsFamily & "," & IntCottageCondo & ""
Set dloRS = Conn.Execute(dlSQL)
%>


I did like you said a few posts ago, I have the strings around single quotes and the integers around double quotes.

I can't believe that this is so hard.

Maybe we should start from scratch.

Is there a way that you can come up with a form that has say 2 textboxes and some checkboxes (no radio buttons). Have the checkboxes post a number to a database, textboxes post text to the database and have it emailed to my email (or any email)?

You know, over the weekend, I looked and lokked for an example of what I am trying to do and couldn't find one anywhere. I really need to get this done. I'm really glad you're willing to still help me. I mean there has to be a way.

Maybe you can see what is wrong with my code before drawing up anything new.

At any rate - I really appreciate the help.

Gary

Morgoth
09-16-2002, 01:39 PM
I'm your friend, I am going to take all your code, and make a form for each text box, under each name.
I will write out exactly what you need for you. I kinda feel guilty for not going this faster.

I am off to school and going to write up the code, but before I do, can you please put this line of code in the place of the code you just told me.

I removed the &_ and I found out what you did.

Try it and see if it works, if so, then I'll stop making the code, if not, I will just write it all up for you :)

<%dlSQL = "INSERT INTO Visitors (FirstName, LastName, Organization, Address, City, State, Zip, CanZip, Country, Phone, eMail, WebsiteInfo, LastVisited, AlleganyStatePark, Amish, AntiquesShopping, BikingHiking, CanoeBoating, Dining, Golf, HuntingFishing, OutdoorScenery, RockCityPark, SenecaPowWow, Skiing, Snowmobile, Spring, Summer, Fall, Winter, OneThree, FourorMore, DayTrip, Vacation, Business, FamilyFriends, HotelMotel, Cabin, BedandBreakfast, Camping, FriendsFamily, CottageCondo) VALUES ('" & StrFirstName & "','" & StrLastName & "','" & StrOrganization & "','" & StrAddress & "','" & StrCity & "','" & StrState & "','" & StrZip & "','" & StrCanZip & "','" & StrCountry & "','" & StrPhone & "','" & StreMail & "','" & StrWebsiteInfo & "','" & StrLastVisited & "'," & IntAlleganyStatePark & "," & IntAmish & "," & IntAntiquesShopping & "," & IntBikingHiking & "," & IntCanoeBoating & "," & IntDining & "," & IntGolf & "," & IntHuntingFishing & "," & IntOutdoorScenery & "," & IntRockCityPark & "," & IntSenecaPowWow & "," & IntSkiing & "," & IntSnowmobile & "," & IntSpring & "," & IntSummer & "," & IntFall & "," & IntWinter & "," & IntOneThree & "," & IntFourorMore & "," & IntDayTrip & "," & IntVacation & "," & IntBusiness & "," & IntFamilyFriends & "," & IntHotelMotel & "," & IntCabin & "," & IntBedandBreakfast & "," & IntCamping & "," & IntFriendsFamily & "," & IntCottageCondo & ")"
Set dloRS = Conn.Execute(dlSQL)
%>

The only problem I think you could have now, if undefind strings and such.

Morgoth
09-16-2002, 02:19 PM
oh no... I forgot to put the zip file on my site to download.

I can't downlaod it it off this site, it's the firewall for this school. It stops me.

Can you do me a favour? I will get started as soon as you e-mail me the file or the zip to my e-mail account. Well, my hotmail account. I use this one for any expected spam mail site, so just e-mail me the file, and i'll get started.

iauruth@hotmail.com

Thanks. ;)

gcapp
09-16-2002, 02:46 PM
Alex,
Ok I emailed you my page.

Thanks
Gary

gcapp
09-16-2002, 02:52 PM
Alex,
By the way, my Visitors tabel has a field called ID that has an autonumber datatype. I didn't know if that made a difference when constructing the script - so I thought I would let you know.

Gary

Morgoth
09-16-2002, 02:58 PM
Well, that's just an ID number. So it will not affect anything.

What I can do is write out the page for all and only the values that I see on your page. I will put comments so you understand what I did.


I'll get to work now.

Please try the code I gave you before.

When i told you to remove the '()'s I didn't mean remove the one that incases all the veriables together. I added it in. What I did, was remove all the &_ and added the '()' back. But only one of them. Try it, see if it works.

gcapp
09-16-2002, 03:28 PM
Alex,
I tried the code you sent me and I still get a syntax error.

Sorry.

Gary

Here's what it looks like:
<%dlSQL = "INSERT INTO Visitors (FirstName, LastName, Organization, Address, City, State, Zip, CanZip, Country, Phone, eMail, WebsiteInfo, LastVisited, AlleganyStatePark, Amish, AntiquesShopping, BikingHiking, CanoeBoating, Dining, Golf, HuntingFishing, OutdoorScenery, RockCityPark, SenecaPowWow, Skiing, Snowmobile, Spring, Summer, Fall, Winter, OneThree, FourorMore, DayTrip, Vacation, Business, FamilyFriends, HotelMotel, Cabin, BedandBreakfast, Camping, FriendsFamily, CottageCondo) VALUES ('" & StrFirstName & "','" & StrLastName & "','" & StrOrganization & "','" & StrAddress & "','" & StrCity & "','" & StrState & "','" & StrZip & "','" & StrCanZip & "','" & StrCountry & "','" & StrPhone & "','" & StreMail & "','" & StrWebsiteInfo & "','" & StrLastVisited & "'," & IntAlleganyStatePark & "," & IntAmish & "," & IntAntiquesShopping & "," & IntBikingHiking & "," & IntCanoeBoating & "," & IntDining & "," & IntGolf & "," & IntHuntingFishing & "," & IntOutdoorScenery & "," & IntRockCityPark & "," & IntSenecaPowWow & "," & IntSkiing & "," & IntSnowmobile & "," & IntSpring & "," & IntSummer & "," & IntFall & "," & IntWinter & "," & IntOneThree & "," & IntFourorMore & "," & IntDayTrip & "," & IntVacation & "," & IntBusiness & "," & IntFamilyFriends & "," & IntHotelMotel & "," & IntCabin & "," & IntBedandBreakfast & "," & IntCamping & "," & IntFriendsFamily & "," & IntCottageCondo & ")"
Set dloRS = Conn.Execute(dlSQL)
%>

whammy
09-16-2002, 03:49 PM
Which fields in your database are actually stored as an integer?

Morgoth
09-16-2002, 03:58 PM
Well, I am almost done the ASP code for that contact page.

A few problems:
First off, I am not going to touch your html, cause I don't think that's the problem... I will read the values and the names, and change them, but I am not going to re-write your form, becuase it's set up the way you had it before, and it will be easier for you too read.

I have no clue what this is, please explain what these do, and where the connection to the db is.


' ///////// Definitions ////////////

'DSN for Businesses Database, tables: Business-listings (business database),Business_category (categories for enchanted database) ,Business_city (city for business listing) ,Business_state (state for business listing)
UPLOAD_DSN = "Businesses" 'alentus
'UPLOAD_DSN = "Businesses" 'alentus

'DSN for Visitors Database, tables: Visitors (responses from contact form), Visitors_interests (interests lookup table, used to populate contact form)
DOWNLOAD_DSN = "Visitors" 'alentus
'DOWNLOAD_DSN = "Visitors" 'alentus

'Name of Mail server used for ASPMail
SMTP_SERVER = "mail.enchantedmountains.info" 'alentus
%>

<% Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open DOWNLOAD_DSN %>


Once you tell me this, I will be bale to finsih the code and work on a table in a db that will simulate your db's table.

;) :D :thumbsup:

Morgoth
09-16-2002, 04:02 PM
Lunch time now. ;)

I looked over the form, and it seems to be ok. Just remember that the value for a checkbox needs to be 1 and a string is blank.

Get back ot me on that info, and I'll get to it when I get back.

Please tell me in detail :)

gcapp
09-16-2002, 04:29 PM
Alex,
I checked the form and all my textboxes has values of "" and the checkboxes have a value of "1".

Gary

gcapp
09-16-2002, 04:51 PM
Alex,
Well I have some good news, although it doesn't have to do with your script you wrote me.
I found a script that does almost exactly what I want it to do. I have the form, you fill it out and it sends the information to my database with numbers in the checkbox columns!
This is like climbing a mountain......... ok, so my form does what I said, but I need it to send an email. The script did not cme with that. The script was bascially to add, delete or update info int he database. I had to alter it to make it just add info to the database, but it didn't come with email.

So now I am asking your help in either way.

If you want to draw up a new script for me and it does EVERYTHING I want it to do, then I'll be more than happy to use it.

or

you can see the pages I have with this new script and see how it can have email put into it.

It's up to you. Again your help is really appreciated. I'm not ignoring what your doing for me, I'm just trying to learn as I go.

Let me know.

Gary

Morgoth
09-16-2002, 05:15 PM
Ok, I did finish the other code, try this and see if it works.
I still don't know the code I posted above, but if it works for you, then this should work.

If the code doesn't work, tell me the error and tell me what that code above, does.

Download the script here.
Change nothing except undefind errors.

http://24.226.62.28/gc/contact-usDONE.txt


Also, send me the code for the NEW form when you have all your veriables and html set up.
I will add the mail and counter script.

gcapp
09-16-2002, 05:44 PM
Alex,
I'll try the code you sent me. In the meantime, here is the pages involved with my new pages. A little more complicated (to me anyway).

Gary

Morgoth
09-16-2002, 06:07 PM
Ok, I have the firewall, so I can't downlaod it, BUT, I am going to be home soon.

Morgoth
09-16-2002, 07:02 PM
Honestly I think you should go with the code that I made up. It works fine, It's all tested, the only problem is when you added your information, you did a number of things that are small and could heardly be seen. I changed alot in the code you had and I edited.

I just don't know what this is:

' ///////// Definitions ////////////

'DSN for Businesses Database, tables: Business-listings (business database),Business_category (categories for enchanted database) ,Business_city (city for business listing) ,Business_state (state for business listing)
UPLOAD_DSN = "Businesses" 'alentus
'UPLOAD_DSN = "Businesses" 'alentus

'DSN for Visitors Database, tables: Visitors (responses from contact form), Visitors_interests (interests lookup table, used to populate contact form)
DOWNLOAD_DSN = "Visitors" 'alentus
'DOWNLOAD_DSN = "Visitors" 'alentus

'Name of Mail server used for ASPMail
SMTP_SERVER = "mail.enchantedmountains.info" 'alentus


And also, I can not find the db connection anywhere! Did you not add it or does that code above have something to do with it?
If I knew what that was, then I be bale to find out what is wrong.

gcapp
09-16-2002, 07:11 PM
Alex,
The code still gives an error. It says:

Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/asp/contact-us.asp, line 343, column 29

This error occurs in this area (i think)

<%
'Check if form is sent or not.
If Request.Form("posted") = "True" Then

'This code is getting the information from the form that was posted and it will be stored into a valeable for use.
StrFirstName = Request.Form("FirstName") & " "
StrLastName = Request.Form("LastName") & " "
StrOrganization = Request.Form("Organization") & " "
StrAddress = Request.Form("Address") & " "
StrCity = Request.Form("City") & " "
StrState= Request.Form("State") & " "
StrZip= Request.Form("Zip") & " "
StrCanZip= Request.Form("CanZip") & " "
StrCountry= Request.Form("Country") & " "
StrPhone= Request.Form("Phone") & " "
StreMail= Request.Form("eMail") & " "
StrWebsiteInfo= Request.Form("WebsiteInfo") & " "
StrLastVisited = Request.Form("LastVisited") & " "
IntAlleganyStatePark = Request.Form("AlleganyStatePark") & " "
IntAmish = Request.Form("Amish") & " "
IntAntiquesShopping = Request.Form("AntiquesShopping") & " "
IntBikingHiking = Request.Form("BikingHiking") & " "
IntCanoeBoating = Request.Form("CanoeBoating") & " "
IntDining = Request.Form("Dining") & " "
IntGolf = Request.Form("Golf") & " "
IntHuntingFishing = Request.Form("HuntingFishing") & " "
IntOutdoorScenery = Request.Form("OutdoorScenery") & " "
IntRockCityPark = Request.Form("RockCityPark") & " "
IntSenecaPowWow = Request.Form("SenecaPowWow") & " "
IntSkiing = Request.Form("Skiing") & " "
IntSnowmobile = Request.Form("Snowmobile") & " "
IntSpring = Request.Form("Spring") & " "
IntSummer = Request.Form("Summer") & " "
IntFall = Request.Form("Fall") & " "
IntWinter = Request.Form("Winter") & " "
IntOneThree = Request.Form("OneThree") & " "
IntFourorMore = Request.Form("FourorMore") & " "
IntDayTrip = Request.Form("DayTrip") & " "
IntVacation = Request.Form("Vacation") & " "
IntBusiness = Request.Form("Business") & " "
IntFamilyFriends = Request.Form("FamilyFriends") & " "
IntHotelMotel = Request.Form("HotelMotel") & " "
IntCabin = Request.Form(Cabin") & " "
IntBedandBreakfast = Request.Form("BedandBreakfast") & " "
IntCamping = Request.Form("Camping") & " "
IntFriendsFamily = Request.Form("FriendsFamily") & " "
IntCottageCondo = Request.Form("CottageCondo") & " "
%>


I don't know.

Gary

Morgoth
09-16-2002, 07:27 PM
REPLACE IntCabin = Request.Form(Cabin") & " " WITH IntCabin = Request.Form("Cabin") & " "

Try now.

gcapp
09-16-2002, 07:29 PM
Alex,
The code you're asking about is the definition of my database connection. It works on all my other pages so I know it is good.

' ///////// Definitions ////////////

'DSN for Businesses Database, tables: Business-listings (business database),Business_category (categories for enchanted database) ,Business_city (city for business listing) ,Business_state (state for business listing)
UPLOAD_DSN = "Businesses" 'alentus
'UPLOAD_DSN = "Businesses" 'alentus

'DSN for Visitors Database, tables: Visitors (responses from contact form), Visitors_interests (interests lookup table, used to populate contact form)
DOWNLOAD_DSN = "Visitors" 'alentus
'DOWNLOAD_DSN = "Visitors" 'alentus

'Name of Mail server used for ASPMail
SMTP_SERVER = "mail.enchantedmountains.info" 'alentus
%>

Right below that is the actual connection. The code is this:


<% Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open DOWNLOAD_DSN %>

Like I said, I get an error when I try your code. If you want to try and change the connection, that's fine with me but i don't know why it wouldn't work.

I mean, the error I'm getting is :

Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/asp/contact-us.asp, line 343, column 29

So I don't know.

Gary

Morgoth
09-16-2002, 08:35 PM
I already told you to REPLACE IntCabin = Request.Form(Cabin") & " " WITH IntCabin = Request.Form("Cabin") & " "

And I think that's the problem, if not then somethings wrong with that error.

If you get the same error then try this:

Move line:
IntCottageCondo = Request.Form("CottageCondo") & " "
above line:
IntFriendsFamily = Request.Form("FriendsFamily") & " "

so it looks like:
IntCottageCondo = Request.Form("CottageCondo") & " "
IntFriendsFamily = Request.Form("FriendsFamily") & " "

Test the code again, if it says the error is on one line higher, we only have the problem with that line, and it's text, or else it's a problem with the group of code.

gcapp
09-16-2002, 09:20 PM
Alex,
Sorry about that. I've been looking at this damn code for so long that I'm going blind!

Well I changed the line you said and added the " to Cabin and I got an error. So I swapped the lines like you said and the error I get is:

Expected statement
/asp/contact-us.asp, line 378, column 8
which starts this section:

'This is the string of text that will be sent to you through e-mail.
StrALL: = "FirstName: " & StrFirstName & vbcrlf &_
"LastName: " & StrLastName & vbcrlf &_
"Organization: " & StrOrganization & vbcrlf &_
"Address: " & StrAddress & vbcrlf &_
"City: " & StrCity & vbcrlf &_
"State: " & StrState & vbcrlf &_
"Zip: " & StrZip & vbcrlf &_
"CanZip: " & StrCanZip & vbcrlf &_
"Country: " & StrCountry & vbcrlf &_
"Phone: " & StrPhone & vbcrlf &_
"eMail: " & StreMail & vbcrlf &_
"WebsiteInfo: " & StrWebsiteInfo & vbcrlf &_
"LastVisited: " & StrLastVisited & vbcrlf &_
"AlleganyStatePark: " & StrAlleganyStatePark &_
"Amish: " & StrAmish & vbcrlf &_
"AntiquesShopping: " & StrAntiquesShopping & vbcrlf &_
"BikingHiking: " & StrBikingHiking & vbcrlf &_
"CanoeBoating: " & StrCanoeBoating & vbcrlf &_
"Dining: " & StrDining & vbcrlf &_
"Golf: " & StrGolf & vbcrlf &_
"HuntingFishing: " & StrHuntingFishing & vbcrlf &_
"OutdoorScenery: " & StrOutdoorScenery & vbcrlf &_
"RockCityPark: " & StrRockCityPark & vbcrlf &_
"SenecaPowWow: " & StrSenecaPowWow & vbcrlf &_
"Skiing: " & StrSkiing & vbcrlf &_
"Snowmobile: " & StrSnowmobile & vbcrlf &_
"Spring: " & StrSpring & vbcrlf &_
"Summer: " & StrSummer & vbcrlf &_
"Fall: " & StrFall & vbcrlf &_
"Winter: " & StrWinter & vbcrlf &_
"OneThree: " & StrOneThree & vbcrlf &_
"FourorMore: " & StrFourorMore & vbcrlf &_
"DayTrip: " & StrDayTrip & vbcrlf &_
"Vacation: " & StrVacation & vbcrlf &_
"Business: " & StrBusiness & vbcrlf &_
"FamilyFriends: " & StrFamilyFriends & vbcrlf &_
"HotelMotel: " & StrHotelMotel & vbcrlf &_
"Cabin: " & StrCabin & vbcrlf &_
"BedandBreakfast: " & StrBedandBreakfast & vbcrlf &_
"Camping: " & StrCamping & vbcrlf &_
"FriendsFamily: " & StrFriendsFamily & vbcrlf &_
"CottageCondo: " & StrCottageCondo & vbcrlf & vbcrlf & vbcrlf &_
"Total of AlleganyStatePark: " & dloRS("IntAlleganyStatePark") & vbcrlf &_
"Total of Amish: " & dloRS("IntAmish") & vbcrlf &_
"Total of AntiquesShopping: " & dloRS("IntAntiquesShopping") & vbcrlf &_
"Total of BikingHiking: " & dloRS("IntBikingHiking") & vbcrlf &_
"Total of CanoeBoating: " & dloRS("IntCanoeBoating") & vbcrlf &_
"Total of Dining: " & dloRS("IntDining") & vbcrlf &_
"Total of Golf: " & dloRS("IntGolf") & vbcrlf &_
"Total of HuntingFishing: " & dloRS("IntHuntingFishing") & vbcrlf &_
"Total of OutdoorScenery: " & dloRS("IntOutdoorScenery") & vbcrlf &_
"Total of RockCityPark: " & dloRS("IntRockCityPark") & vbcrlf &_
"Total of SenecaPowWow: " & dloRS("IntSenecaPowWow") & vbcrlf &_
"Total of Skiing: " & dloRS("IntSkiing") & vbcrlf &_
"Total of Snowmobile: " & dloRS("IntSnowmobile") & vbcrlf &_
"Total of Spring: " & dloRS("IntSpring") & vbcrlf &_
"Total of Summer: " & dloRS("IntSummer") & vbcrlf &_
"Total of Fall: " & dloRS("IntFall") & vbcrlf &_
"Total of Winter: " & dloRS("IntWinter") & vbcrlf &_
"Total of OneThree: " & dloRS("IntOneThree") & vbcrlf &_
"Total of FourorMore: " & dloRS("IntFourorMore") & vbcrlf &_
"Total of DayTrip: " & dloRS("IntDayTrip") & vbcrlf &_
"Total of Vacation: " & dloRS("IntVacation") & vbcrlf &_
"Total of Business: " & dloRS("IntBusiness") & vbcrlf &_
"Total of FamilyFriends: " & dloRS("IntFamilyFriends") & vbcrlf &_
"Total of HotelMotel: " & dloRS("IntHotelMotel") & vbcrlf &_
"Total of Cabin: " & dloRS("IntCabin") & vbcrlf &_
"Total of BedandBreakfast: " & dloRS("IntBedandBreakfast") & vbcrlf &_
"Total of Camping: " & dloRS("IntCamping") & vbcrlf &_
"Total of FriendsFamily: " & dloRS("IntFriendsFamily") & vbcrlf &_
"Total of CottageCondo: " & dloRS("IntCottageCondo")

That's where I"m at

gary

Morgoth
09-16-2002, 11:56 PM
LOL!!!!
remove : from StrALL
HAHahahaha....

Line should look like:
StrALL = "FirstName: " & StrFirstName & vbcrlf &_

gcapp
09-17-2002, 12:34 AM
Remove what???

I must be nuts - you said remove : from StrALL so the line looks like this:

StrALL: = "FirstName: " & StrFirstName & vbcrlf &_


Well doesn't it look like that now?

'This is the string of text that will be sent to you through e-mail.
StrALL: = "FirstName: " & StrFirstName & vbcrlf &_
"LastName: " & StrLastName & vbcrlf &_
"Organization: " & StrOrganization & vbcrlf &_
"Address: " & StrAddress & vbcrlf &_
"City: " & StrCity & vbcrlf &_
"State: " & StrState & vbcrlf &_
"Zip: " & StrZip & vbcrlf &_
"CanZip: " & StrCanZip & vbcrlf &_
"Country: " & StrCountry & vbcrlf &_
"Phone: " & StrPhone & vbcrlf &_
"eMail: " & StreMail & vbcrlf &_
"WebsiteInfo: " & StrWebsiteInfo & vbcrlf &_
"LastVisited: " & StrLastVisited & vbcrlf &_
"AlleganyStatePark: " & StrAlleganyStatePark &_
"Amish: " & StrAmish & vbcrlf &_
"AntiquesShopping: " & StrAntiquesShopping & vbcrlf &_
"BikingHiking: " & StrBikingHiking & vbcrlf &_
"CanoeBoating: " & StrCanoeBoating & vbcrlf &_
"Dining: " & StrDining & vbcrlf &_
"Golf: " & StrGolf & vbcrlf &_
"HuntingFishing: " & StrHuntingFishing & vbcrlf &_
"OutdoorScenery: " & StrOutdoorScenery & vbcrlf &_
"RockCityPark: " & StrRockCityPark & vbcrlf &_
"SenecaPowWow: " & StrSenecaPowWow & vbcrlf &_
"Skiing: " & StrSkiing & vbcrlf &_
"Snowmobile: " & StrSnowmobile & vbcrlf &_
"Spring: " & StrSpring & vbcrlf &_
"Summer: " & StrSummer & vbcrlf &_
"Fall: " & StrFall & vbcrlf &_
"Winter: " & StrWinter & vbcrlf &_
"OneThree: " & StrOneThree & vbcrlf &_
"FourorMore: " & StrFourorMore & vbcrlf &_
"DayTrip: " & StrDayTrip & vbcrlf &_
"Vacation: " & StrVacation & vbcrlf &_
"Business: " & StrBusiness & vbcrlf &_
"FamilyFriends: " & StrFamilyFriends & vbcrlf &_
"HotelMotel: " & StrHotelMotel & vbcrlf &_
"Cabin: " & StrCabin & vbcrlf &_
"BedandBreakfast: " & StrBedandBreakfast & vbcrlf &_
"Camping: " & StrCamping & vbcrlf &_
"FriendsFamily: " & StrFriendsFamily & vbcrlf &_
"CottageCondo: " & StrCottageCondo & vbcrlf & vbcrlf & vbcrlf &_
"Total of AlleganyStatePark: " & dloRS("IntAlleganyStatePark") & vbcrlf &_
"Total of Amish: " & dloRS("IntAmish") & vbcrlf &_
"Total of AntiquesShopping: " & dloRS("IntAntiquesShopping") & vbcrlf &_
"Total of BikingHiking: " & dloRS("IntBikingHiking") & vbcrlf &_
"Total of CanoeBoating: " & dloRS("IntCanoeBoating") & vbcrlf &_
"Total of Dining: " & dloRS("IntDining") & vbcrlf &_
"Total of Golf: " & dloRS("IntGolf") & vbcrlf &_
"Total of HuntingFishing: " & dloRS("IntHuntingFishing") & vbcrlf &_
"Total of OutdoorScenery: " & dloRS("IntOutdoorScenery") & vbcrlf &_
"Total of RockCityPark: " & dloRS("IntRockCityPark") & vbcrlf &_
"Total of SenecaPowWow: " & dloRS("IntSenecaPowWow") & vbcrlf &_
"Total of Skiing: " & dloRS("IntSkiing") & vbcrlf &_
"Total of Snowmobile: " & dloRS("IntSnowmobile") & vbcrlf &_
"Total of Spring: " & dloRS("IntSpring") & vbcrlf &_
"Total of Summer: " & dloRS("IntSummer") & vbcrlf &_
"Total of Fall: " & dloRS("IntFall") & vbcrlf &_
"Total of Winter: " & dloRS("IntWinter") & vbcrlf &_
"Total of OneThree: " & dloRS("IntOneThree") & vbcrlf &_
"Total of FourorMore: " & dloRS("IntFourorMore") & vbcrlf &_
"Total of DayTrip: " & dloRS("IntDayTrip") & vbcrlf &_
"Total of Vacation: " & dloRS("IntVacation") & vbcrlf &_
"Total of Business: " & dloRS("IntBusiness") & vbcrlf &_
"Total of FamilyFriends: " & dloRS("IntFamilyFriends") & vbcrlf &_
"Total of HotelMotel: " & dloRS("IntHotelMotel") & vbcrlf &_
"Total of Cabin: " & dloRS("IntCabin") & vbcrlf &_
"Total of BedandBreakfast: " & dloRS("IntBedandBreakfast") & vbcrlf &_
"Total of Camping: " & dloRS("IntCamping") & vbcrlf &_
"Total of FriendsFamily: " & dloRS("IntFriendsFamily") & vbcrlf &_
"Total of CottageCondo: " & dloRS("IntCottageCondo")


Or am I high??????????

Morgoth
09-17-2002, 12:50 AM
Remove the > > > > > > > > :

The COLLIN! :)

REMOVE IT!!
lol


<addition>
We are going to have to hurry up with this topic.
I think it would of been alot easier if I could get a list or a copy of the table to look at and test the code myself.
Then the problem will be solved and we can end the worlds longers ASP question :)
I just got offered to work on my site so when it's done, I can get paid for making other sites. :)
</addition>

Morgoth
09-17-2002, 03:16 PM
Did it work?

gcapp
09-17-2002, 05:06 PM
Alex,
Ok maybe we're getting closer. The error I get now is this:

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/asp/contact-us.asp, line 473


And that line is:
<%
'close database
conn.close
set conn = nothing
%>

It's actually the 'close.database line.

Ok I attached my Visitors database, maybe that will help.

Can today be the day I can get this to work????

gcapp
09-17-2002, 07:08 PM
Ok, here is the page and i removed the form parts with textboxes. Checkboxes are the only part left and all the asp code that you wrote.

Morgoth
09-17-2002, 07:09 PM
Why did you remove the text boxes?

Morgoth
09-17-2002, 07:22 PM
I have this code here, that has the text boxes and has the check boxes. This will work now that I have the db we will see what happens. It seems you have your db correctly put togehter, one of my big concerns were, that it wasn't. ;)


I am removing the code:

'DSN for Businesses Database, tables: Business-listings (business database),Business_category (categories for enchanted database) ,Business_city (city for business listing) ,Business_state (state for business listing)
UPLOAD_DSN = "Businesses" 'alentus
'UPLOAD_DSN = "Businesses" 'alentus

'DSN for Visitors Database, tables: Visitors (responses from contact form), Visitors_interests (interests lookup table, used to populate contact form)
DOWNLOAD_DSN = "Visitors" 'alentus
'DOWNLOAD_DSN = "Visitors" 'alentus

'Name of Mail server used for ASPMail
SMTP_SERVER = "mail.enchantedmountains.info" 'alentus


You can add the SMTP_Server after, if it's needed.
And I don't know what the UPLOAD_DSN is for but it doesn't seem to be needed, I removed it.
Last is the DOWNLOAD_DSN, I removed it
And I also changed Conn.Open Visitors to Conn.Open StrdlConn
and StrdlConn is
StrdlConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("gary.mdb") & ";"

Now I know you may have a method that keeps your db connection split up some how, but I don't really see the point. There is a 10% chance you will need to change your DB connection driver or name after the script is complete. So keeping it in another file is pointless, or atleast it is too me. :P

Well, enough of that.
I will send you the finsihed code right after I test it and make the corrections to any errors :)

Morgoth
09-17-2002, 08:37 PM
lol
I got it now...
Took me a bit, but it's done.


Now, as I said before, I added the db connection thing.
You can remove it and add your own thing, as long as you make sure your using the name veriables and such.

Try this.

gcapp
09-18-2002, 03:31 AM
Alex,
I will try your code in the morning. It's real late.

Hopefully it wil work for me. I will let you know.

Morgoth
09-18-2002, 04:44 AM
Ok, just remember that I added the DB line, if you really want to change it, go ahead, but let me just say the code works ok right now. I tested it, the e-mail script works, and the inserting into a db works.

gcapp
09-18-2002, 02:23 PM
Alex,
Ok well there is one glitch an dmay have to do with the email part.

After filling out the form, I get an error which is unspecified - it says:

Error Type:
(0x80070003)
/asp/contact-us.asp, line 447


Line 447 is in this section in bold:

'This e-mail commponent should be on your server, and it will send the e-mail, change it to what ever e-mail commponent you like/use.
Set mailObj = CreateObject("CDONTS.NewMail")
With mailObj
.BodyFormat = 1 ' 1=Text, 0=HTML
.MailFormat = 1 ' 1=Text, 0=MIME
.Importance = 1 ' 0=Low, 1=Normal, 2=High
.To = "visitor@enchantedmountains.info"
.Cc = ""
.Bcc = ""
.Subject = "Contact Form"
.Body = StrALL
.From = "NAME <EMAIL>"
.Value("Reply-To") = "EMAIL"
.Send
End With

Set mailObj = Nothing


What could be the reason for this? Do I have to change any setting in this section at all??

Gary

gcapp
09-18-2002, 02:50 PM
Alex,
Ok I'm almost at 100% completion. I had to make some adjustments ot the email and now everything works except one thing - the informaton that goes to the database is being recorded in every field EXCEPT the first field which is FirstName. Nothing is going into that field. I even tried to send just the FirstName info in the form and the record in the database had nothing for First Name.

Why would this be?

Gary

gcapp
09-18-2002, 02:57 PM
SUCCESS!!!!!!!!!!!!!!!!!!!!!!!!

I finally got everything to work!!!!!!!!!!!!!

Alex - thanks so much. I know I've been a pain in the a**, but without guys like you, we beginners would be lost.

Can you answer me one general question - since you changed my database connection to a DSN-less, is it best to do that on all my asp pages or is a DSN connection better??




Hey I don't know if you're really into music, but I have a huge list of bootleg shows. I could burn you off some stuff to repay you for what you did for me. If you want the list, let me know and i"ll attach it to another post.

Again Thanks!!!

Morgoth
09-18-2002, 03:18 PM
Well, I am not to sure exactly how DSN works, but I know I have no problem with Access, and the Microsoft driver.

I think you would should use any type of database you want. If you can change your db type for the file I gave you, there should be no problem with the code.

I have no idea why you had a problem with your mail script, but I am glad you found one that works.

Since you now know it works, try to customize it to your EXACT liking. Cause If you make an error and you are very stuck, you can either ask, or you can go back to the old script :) Me trying stuff liek that helped me learn ASP.


I don't think we are allowed to talk about bootlegs, and I already said I don't need anything for helping you. I feel better about myself when I help someone.

whammy
09-19-2002, 02:08 AM
Take it from my experience - a DSN-Less connection is better if you have the option to use one; because if your network admin gets a wild hair and decides to move all of the websites on the network to a different server, that will save you from having to set up a DSN on the machine.

This also applies to using Server.MapPath when possible instead of mapping a local path to a file like E:\Whatever

:)

Morgoth
09-19-2002, 06:19 AM
I see.
I run IIS 5.0, could I set up a DSN?

gcapp
09-19-2002, 01:25 PM
Alex,
Hey something I know about!! Yes you can set up a DSN with IIS 5.0. That is what I use. You just have to go into Administration Tools - Data Sources(ODBC) and then the System Tools tab and set up your DSN and your database.

Morgoth
09-19-2002, 01:36 PM
Great! Thanks!

whammy
09-21-2002, 05:13 PM
Since it looks like everyone is happy, I'm going to close this thread.

Please feel free to post any additional questions you might have, gcapp. :)