Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Little Query BIG Problems! Please look over this..
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

enidesigns
Starting Member

15 Posts

Posted - 01 May 2002 :  17:24:01  Show Profile
The situation -
I am writing a small streaming media service based on my own compositions. From the main album listing, a hard coded GUID is sent to the listen page when a user clicks on a songs link (example: listen.asp?id=48B33616-3AA1-4896-9B74-9A829F6F854C). Simple enough.

On listen.asp, it's obviously easy to retrieve the id by using the request.querystring function. Using the id, I query the database to look for it's match in the main track listing, from which I pull the track's information from the record. (This information includes song length, notes and urls that will be used to stream the audio (selectable bandwidth)).

Here is where the code has problems...

dim objConnection
set objConnection = server.CreateObject("adodb.connection")
objConnection.Open strConnString

dim ret
ret=request.querystring("id")

SQL="SELECT * FROM TBL_TRACK_MASTER"
SQL=SQL & "WHERE (((TBL_TRACK_MASTER.M_GUID)="" & RET & ""));"

Dim rspod
Set rspod=Server.CreateObject(ADODB.Recordset")
rspod.Open sql, strConnString, 3, ,adCmdText

Any calls I make to rspod after this point results in this:
(example of one call: response.write "Title = " & rspod("M_TITLE")

error '80020009'
Exception occurred.

/Forum/listen.asp, line xx

More confusing (to me), is the fact that if I hard code the GUID into the query string, like so...

SQL="SELECT * FROM TBL_TRACK_MASTER"
SQL=SQL & "WHERE (((TBL_TRACK_MASTER.M_GUID)=""48B33616-3AA1-4896-9B74-9A829F6F854C""));"

...then there are absolutely NO problems. So, it's obvious that I have something wrong with my SQL query string. But where? I've spend hours and hours and sigh..hours trying variations but no luck, so now Im begging for someone to help me.

Thanks for reading my story :)
Enidesigns







ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 01 May 2002 :  17:40:54  Show Profile  Send ruirib a Yahoo! Message
Try it like this:

SQL="SELECT * FROM TBL_TRACK_MASTER"
SQL=SQL & "WHERE (((TBL_TRACK_MASTER.M_GUID)=""" & RET & """));"


-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

enidesigns
Starting Member

15 Posts

Posted - 01 May 2002 :  17:48:57  Show Profile
LoL!

You know, I WAS going to reply and say "thanks, but I already did that...", but I figured I'd give it one more shot...and bygosh, it worked!

Thanks, ruirib for your VERY quick response! You da man!
(Now I just feel kinda stupid for the number of hours i've attempted to fix it myself...)

Regards,
Mark
Enidesigns

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 01 May 2002 :  17:54:36  Show Profile  Send ruirib a Yahoo! Message
Glad it worked . That's a pretty common mistake, so no reason to chastise yourself .

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.26 seconds. Powered By: Snitz Forums 2000 Version 3.4.07