[FONT=Arial]The short version of my question is:[/FONT]
[FONT=Arial]“How can I modify a SQL query inside an ASP-page using values coming from Flash variables inside a movie clip?”[/FONT]
[FONT=Arial]Below is the background information of my question:[/FONT]
[FONT=Arial]What I have that works:[/FONT]
[FONT=Arial]I have successfully linked an access database with a Flash interface, where the user selects a category, and data from the access database is displayed in dynamic text boxes. The ASP file includes a Query which narrows the data to be shown. Below is the ASP code (generated by Dreamweaver MX) I’m using to do this:[/FONT]
[FONT=Arial]<%@LANGUAGE="VBSCRIPT"%>[/FONT]
[FONT=Arial]<!--#include file="Connections/con_ref.asp" -->[/FONT]
[FONT=Arial]<%[/FONT]
[FONT=Arial]Dim rsRef[/FONT]
[FONT=Arial]Dim rsRef_numRows[/FONT]
[FONT=Arial]Set rsRef = Server.CreateObject("ADODB.Recordset")[/FONT]
[FONT=Arial]rsRef.ActiveConnection = MM_con_ref_STRING[/FONT]
[FONT=Arial]rsRef.Source = "SELECT * FROM CohoWs WHERE poly_cid=31 AND ref_art_id =9"[/FONT]
[FONT=Arial]rsRef.CursorType = 0[/FONT]
[FONT=Arial]rsRef.CursorLocation = 2[/FONT]
[FONT=Arial]rsRef.LockType = 1[/FONT]
[FONT=Arial]rsRef.Open()[/FONT]
[FONT=Arial]rsRef_numRows = 0[/FONT]
[FONT=Arial]%>[/FONT]
[FONT=Arial]&sw_cite=<%=(rsRef.Fields.Item("sw_cite").Value)%>[/FONT]
[FONT=Arial]&sw_ref_title=<%=(rsRef.Fields.Item("sw_ref_title").Value)%>[/FONT]
[FONT=Arial]&sw_ref_source=<%=(rsRef.Fields.Item("sw_ref_source").Value)%>[/FONT]
[FONT=Arial]&sw_rating=<%=(rsRef.Fields.Item("sw_all_chan_grad").Value)%>[/FONT]
[FONT=Arial]&sw_ref_comments=<%=(rsRef.Fields.Item("sw_ref_comments").Value)%> [/FONT]
[FONT=Arial]<%[/FONT]
[FONT=Arial]rsRef.Close()[/FONT]
[FONT=Arial]Set rsRef = Nothing[/FONT]
[FONT=Arial]%>[/FONT]
[FONT=Arial]And this is the Flash code that I use to retrieve the data from ASP to my movie clip:[/FONT]
[FONT=Arial]this.loadVariables(“MyText.asp”)[/FONT]
[FONT=Arial]What I want to accomplish: I would like to modify the query inside my ASP so that different data is shown depending on the category chosen by the user. Instead of writing a second ASP page with another query (I have hundreds of categories), I would like to have flash send the variables (simple numbers) I need to modify the query to my ASP page. I should add that the variables I want to send from flash to ASP are located inside a movie clip.[/FONT]
[FONT=Arial]The ASP code I’m using to accomplish this (also generated by Dreamweaver MX) is shown below:[/FONT]
[FONT=Arial]<%@LANGUAGE="VBSCRIPT"%>[/FONT]
[FONT=Arial]<!--#include file="Connections/con_ref.asp" -->[/FONT]
[FONT=Arial]<%[/FONT]
[FONT=Arial]Dim rsRef__ws_id[/FONT]
[FONT=Arial]rsRef__ws_id = "0"[/FONT]
[FONT=Arial]If (Request.QueryString("ws_id") <> "") Then [/FONT]
[FONT=Arial] rsRef__ws_id = Request.QueryString("ws_id")[/FONT]
[FONT=Arial]End If[/FONT]
[FONT=Arial]%>[/FONT]
[FONT=Arial]<%[/FONT]
[FONT=Arial]Dim rsRef__ref_id[/FONT]
[FONT=Arial]rsRef__ref_id = "0"[/FONT]
[FONT=Arial]If (Request.QueryString("ref_id") <> "") Then [/FONT]
[FONT=Arial] rsRef__ref_id = Request.QueryString("ref_id") [/FONT]
[FONT=Arial]End If[/FONT]
[FONT=Arial]%>[/FONT]
[FONT=Arial]<%[/FONT]
[FONT=Arial]Dim rsRef[/FONT]
[FONT=Arial]Dim rsRef_numRows[/FONT]
[FONT=Arial]Set rsRef = Server.CreateObject("ADODB.Recordset")[/FONT]
[FONT=Arial]rsRef.ActiveConnection = MM_con_ref_STRING[/FONT]
[FONT=Arial]rsRef.Source = "SELECT * FROM CohoWs WHERE poly_cid=" + Replace(rsRef__ws_id, "'", "''") + " AND ref_art_id =" + Replace(rsRef__ref_id, "'", "''") + ""[/FONT]
[FONT=Arial]rsRef.CursorType = 0[/FONT]
[FONT=Arial]rsRef.CursorLocation = 2[/FONT]
[FONT=Arial]rsRef.LockType = 1[/FONT]
[FONT=Arial]rsRef.Open()[/FONT]
[FONT=Arial]rsRef_numRows = 0[/FONT]
[FONT=Arial]%>[/FONT]
[FONT=Arial]&sw_cite=<%=(rsRef.Fields.Item("sw_cite").Value)%>[/FONT]
[FONT=Arial]&sw_ref_title=<%=(rsRef.Fields.Item("sw_ref_title").Value)%>[/FONT]
[FONT=Arial]&sw_ref_source=<%=(rsRef.Fields.Item("sw_ref_source").Value)%>[/FONT]
[FONT=Arial]&sw_rating=<%=(rsRef.Fields.Item("sw_all_chan_grad").Value)%>[/FONT]
[FONT=Arial]&sw_ref_comments=<%=(rsRef.Fields.Item("sw_ref_comments").Value)%> [/FONT]
[FONT=Arial]<%[/FONT]
[FONT=Arial]rsRef.Close()[/FONT]
[FONT=Arial]Set rsRef = Nothing[/FONT]
[FONT=Arial]%>
[/FONT]
[FONT=Arial]However, this is not working for me, because ASP is not able to retrieve the value of my Flash variables. This is the Flash code I have been using (with no success) to try to communicate with ASP:[/FONT]
[FONT=Arial]This.loadVariables (“MyText.asp”,0,”GET”)[/FONT]
[FONT=Arial]ws_id = 31;[/FONT]
[FONT=Arial]ref_id = 9;[/FONT]
[FONT=Arial]Here I think is where my problem is. I suspect that Flash is not passing the variables to ASP at all, probably because my code is far from correct…right?[/FONT]
[FONT=Arial]I have been reading all tutorials and forums that deal with Flash and ASP, but I cannot make it work. [/FONT]
[FONT=Arial]If you have any idea of how to do this please help me out.[/FONT]
Thanks!