accessing an .asp file

  • aspenlumberjack
  • Born
  • Born
  • aspenlumberjack
  • Posts: 2
  • Loc: aspen

Post 3+ Months Ago

I am working through a tutorial book on Action Script. This excercise
has a 'online poll' where
you can cast your vote in a radio button, submit those and get the
results returned on a page
with bargraphs.

see: www22.brinkster.com/mountain2ocean/poll2.swf

An .asp file as well as a .mdb file are supplied with the book on a cd.
(Poll.asp
Poll.mdb )

I uploaded all as instructed.

I checked, double, triple and quadruple checked my .fla for typo's,
etc. In the end I copied and pasted the code from the books' cd with completed excercises to make sure it's correct without typos and errors.

in the code the URL is referred to as:
pollURL = "http://www22.brinkster.com/mountain2ocean/poll.asp";

My .swf is in the same directory as the .asp and .mdb.
the actual swf (and the nature of the problem) I tried, uppercase,
lowercase, I tried everything. Why won't it show the percentages? Is it not accessing the asp file?

Please help me out I'm trying to learn this on my own and have no help,
this particular part
(data in and out of the server) I would really like to master. Please
help me I'm stuck


Thanks Danno



additional: some of the code

Code: [ Select ]
stop();
pollURL = "http://www22.brinkster.com/mountain2ocean/poll2.swf";
function pollLoaded() {
_root.gotoAndStop("display");
}
poll = new LoadVars();
poll.onLoad = pollLoaded;
function submitChoice() {
var choice = radioGroup.getData();
poll.load(pollURL+"?choice="+choice);
_root.gotoAndStop("waiting");
}
  1. stop();
  2. pollURL = "http://www22.brinkster.com/mountain2ocean/poll2.swf";
  3. function pollLoaded() {
  4. _root.gotoAndStop("display");
  5. }
  6. poll = new LoadVars();
  7. poll.onLoad = pollLoaded;
  8. function submitChoice() {
  9. var choice = radioGroup.getData();
  10. poll.load(pollURL+"?choice="+choice);
  11. _root.gotoAndStop("waiting");
  12. }



Then there is the actual return and display code

Code: [ Select ]
for (i=1;i<=4;++i) {
var graphName="barGraph"+i;
var votes=poll["item"+i+"total"];
var totalVotes=poll.totalVotes;
var percent=Math.round((votes/totalVotes)*100);
_root[graphName].bar._xscale=percent;
_root[graphname].topPercent.text=percent+"%";
_root[graphname].bottomPercent.text=percent+"%";
}
  1. for (i=1;i<=4;++i) {
  2. var graphName="barGraph"+i;
  3. var votes=poll["item"+i+"total"];
  4. var totalVotes=poll.totalVotes;
  5. var percent=Math.round((votes/totalVotes)*100);
  6. _root[graphName].bar._xscale=percent;
  7. _root[graphname].topPercent.text=percent+"%";
  8. _root[graphname].bottomPercent.text=percent+"%";
  9. }


PS the radio buttons choice values are respectively 1,2,3,4
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

code tags please ;)
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

Somewhere in the ASP script should be the code to connect to the database. My first guess is that you have the location of the database or username and password (if required) incorrect. By initial appearances, it's not making the connection to the database. Also make sure you are using the correct JET drivers. Your host provider should have help information available with instructions on connecting to an Access database. Check there first, because how you connect to the database can very depending on how the host has things configured.
  • aspenlumberjack
  • Born
  • Born
  • aspenlumberjack
  • Posts: 2
  • Loc: aspen

Post 3+ Months Ago

Eureka!

The problem is that my particular server requires to have the poll.mdb file in a /db/ subdirectory(that is for all all .mdb files). Even stronger, when I had a copy of the .mdb file in both the root as well as that sub directory (I suspected the asp coudn't find the .mdb) the thing wouldn't work!

Is that normal on servers?

Danno, thanks for the help everyone.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

Fairly normal. The Access database needs to be in a directory with read/write permissions. Some hosts control where that directory is. Other's allow you to change permissions and put it wherever you want it. Anyway, glad you got it.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 9 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.