HighDots Forums  

VBScript link question.....

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss VBScript link question..... in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Slowtroll
 
Posts: n/a

Default VBScript link question..... - 12-01-2005 , 05:09 PM






How would I format the URL below to call a specific database record? The
result page does not display specific code in the URL or, I would simply use
it. The query and the results page are both done with Dreamweaver MX 6.1, ASP,
and VBScript.

http://mydomain.com/display_locations.asp

In the past, I have used
http://mydomain.com/display_location...ieldname=value but it does not
work in this case.

Instead, I get an error message:

<--- error message --->

ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested
operation requires a current record.

<--- end error --->

Suggestions greatly appreciated.

Thank you very much.

Trent Roberson




Reply With Quote
  #2  
Old   
Chris In Madison
 
Posts: n/a

Default Re: VBScript link question..... - 12-01-2005 , 05:24 PM






It should still work that way, but you have to adjust your SQL query to use
the querystring value at the end of your URL. In the case you cited, it
would be:

strSQL = "SELECT myFields FROM myTable WHERE myOtherField = '" &
Request.QueryString("fieldname") "'"

Now, that's the short story (overall concept). The above method doesn't
take error checking, datatype validation, and other nifty security-related
things into account that would keep people from doing ugly things to your
database. However, that should give you the idea. Keep in mind that with
ASP, if you use POST with your form, it doesn't append anything to the URL
and you have to use Request.Form() to get at the data. If you have
parameters at the end of your URL, this usually assume a GET method from
your form (or just a triggering method from a dynamically created URL) and
you have to use Request.QueryString(). There are shortcut methods as well,
but that should give you a better idea of which methods look for what kind
of data.

Best regards,
Chris



Reply With Quote
  #3  
Old   
darrel
 
Posts: n/a

Default Re: VBScript link question..... - 12-01-2005 , 05:24 PM




"Slowtroll" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
How would I format the URL below to call a specific database record? The
result page does not display specific code in the URL or, I would simply
use
it. The query and the results page are both done with Dreamweaver MX 6.1,
ASP,
and VBScript.

http://mydomain.com/display_locations.asp

In the past, I have used
http://mydomain.com/display_location...ieldname=value but it does
not
work in this case.
There's a whole bunch of code/logic we're missing here to fully figure out
what your specific problem may be.

Your URL would likely be this:

http://mydomain.com/display_locations.asp?location=12

Then on that page, you'd have to grab the querystring.

Then, take that variable and pass that to your db query. Probably look like
this:

SELECT * FROM yourLocationsTable WHERE locationID = 12

Then you'd grab the data and render it on screen.

Quote:
Either BOF or EOF is True, or the current record has been deleted.
Requested
operation requires a current record.
Looks like you are trying to grab data from a query that returned no data.
You will want to check for that in your code.

-Darrel




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.