
Welcome Guest
|
#1
|
|||
|
|||
|
asp problems
I'm having problems with the ASP of setting up the vars for flash to get them. I have a flash form with 31 checkboxes. The user selects any and as many check boxes in the first 29 of them and the last 2 the user selects but these two help narrow down the records to pull from the db.
I'm using a flash form and the checkbox values for Flash checkboxes are defaulted to false. All of the check boxes run independently.... (except for DINE_IN & DINE_OUT , i'll get to those later) How this works is the user selects what meal type they want and they can select more than one, then the user selects a dine_in or/and dine out value. In the db there are records where both dine_in and dine_out apply to the meal, so i included that db value into the selection(s). So basically what i'm doing is creating the sql where the first set of selection are true and where dine_in or/and dine_out are selected and pulling all info for those records. I've managed to create this asp page but Flash only properly gets the values when the sql is "select * from logbook" another words when no selection is made just the submit button is pushed in the flash movie. i'm thinking this is becasue the sql is poorly written, needs to be more refined. This is my asp page (maybe there is some ?other? reason flash can only grab the value pairs when the sql = "select * from logbook" and i've response.writen the sql in this long version and it is like this format: sql = "select * from logbook WHERE cusine IN ('AFRICAN','GERMAN') AND eat IN ('BOTH','DINE_OUT')" code:-------------------------------------------------------------------------------- DINE_IN = Request.Form("DINE_IN") DINE_OUT = Request.Form("DINE_OUT") Dim Serv, Conn, RecordView, Ename, output, collect, SQL, Eeat, Ephone, collectaa Dim collectbb, collectdd , collect4, collectfg, collecthi, collect6, collect7, collectuu Dim eoutput, eeoutput, e4output, e6eoutput, ae2output, eb7output, e7output, e9output, emoutput Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "DBQ=" & Server.MapPath("\4d9b\db.mdb") & ";" & _ "DRIVER=Microsoft Access Driver (*.mdb)" SQL = "SELECT * FROM logbook WHERE cusine IN (" AFRICAN = Request.Form("AFRICAN") If AFRICAN = "true" Then SQL = SQL & "'AFRICAN'," End If CARIBBEAN = Request.Form("CARIBBEAN") If CARIBBEAN = "true" Then SQL = SQL & "'CARIBBEAN'," End If CHINESE = Request.Form("CHINESE") If CHINESE = "true" Then SQL = SQL & "'CHINESE'," End If CONTINENTAL = Request.Form("CONTINENTAL") If CONTINENTAL = "true" Then SQL = SQL & "'CONTINENTAL'," End If DUTCH = Request.Form("DUTCH") If DUTCH = "true" Then SQL = SQL & "DUTCH'," End If EAST_INDIAN = Request.Form("EAST_INDIAN") If EAST_INDIAN = "true" Then SQL = SQL & "'EAST_INDIAN'," End If ENGLISH = Request.Form("ENGLISH") If ENGLISH = "true" Then SQL = SQL & "'ENGLISH'," End If ETHIOPIAN = Request.Form("ETHIOPIAN") If ETHIOPIAN = "true" Then SQL = SQL & "'ETHIOPIAN'," End If FONDUES = Request.Form("FONDUES") If FONDUES = "true" Then SQL = SQL & "'FONDUE'," End If FRENCH = Request.Form("FRENCH") If FRENCH = "true" Then SQL = SQL & "'FRENCH'," End If FUSION = Request.Form("FUSION") If FUSION = "true" Then SQL = SQL & "'FUSION'," End If GERMAN = Request.Form("GERMAN") If GERMAN = "true" Then SQL = SQL & "'GERMAN'," End If GREEK = Request.Form("GREEK") If GREEK = "true" Then SQL = SQL & "'GREEK'," End If ITALIAN = Request.Form("ITALIAN") If ITALIAN = "true" Then SQL = SQL & "'ITALIAN'," End If JAPANESE = Request.Form("JAPANESE") If JAPANESE = "true" Then SQL = SQL & "'JAPANESE'," End If JEWISH = Request.Form("JEWISH") If JEWISH = "true" Then SQL = SQL & "'JEWISH'," End If KOREAN = Request.Form("KOREAN") If KOREAN = "true" Then SQL = SQL & "'KOREAN'," End If MEDITERRANEAN = Request.Form("MEDITERRANEAN") If MEDITERRANEAN = "true" Then SQL = SQL & "'MEDITERRANEAN'," End If MEXICAN = Request.Form("MEXICAN") If MEXICAN = "true" Then SQL = SQL & "'MEXICAN'," End If MONGOLIAN = Request.Form("MONGOLIAN") If MONGOLIAN = "true" Then SQL = SQL & "'MONGOLIAN'," End If PAKISTANI = Request.Form("PAKISTANI") If PAKISTANI = "true" Then SQL = SQL & "'PAKISTANI'," End If PHILIPPINE = Request.Form("PHILIPPINE") If PHILIPPINE = "true" Then SQL = SQL & "'PHILIPPINE'," End If PIZZA = Request.Form("PIZZA") If PIZZA = "true" Then SQL = SQL & "'PIZZA'," End If PORTUGUESE = Request.Form("PORTUGUESE") If PORTUGUESE = "true" Then SQL = SQL & "'PORTUGUESE'," End If RIBS = Request.Form("RIBS") If RIBS = "true" Then SQL = SQL & "'RIBS'," End If STEAK_HOUSES = Request.Form("STEAK_HOUSES") If STEAK_HOUSES = "true" Then SQL = SQL & "'STEAK_HOUSES'," End If THAILAND = Request.Form("THAILAND") If THAILAND = "true" Then SQL = SQL & "'THAILAND'," End If UKRAINIAN = Request.Form("UKRAINIAN") If UKRAINIAN = "true" Then SQL = SQL & "'UKRAINIAN'," End If VEGETARIAN = Request.Form("VEGETARIAN") If VEGETARIAN = "true" Then SQL = SQL & "'VEGETARIAN'," End If VIETNAMESE = Request.Form("VIETNAMESE") If VIETNAMESE = "true" Then SQL = SQL & "'VIETNAMESE'," End If WEST_INDIAN = Request.Form("WEST_INDIAN") If WEST_INDIAN = "true" Then SQL = SQL & "'WEST_INDIAN'" End If If (DINE_IN = "true" AND DINE_OUT = "true") Then SQL = SQL & ") AND eat IN ('BOTH','DINE_IN','DINE_OUT')" elseIf (DINE_IN = "true" AND DINE_OUT = "false") Then SQL = SQL & ") AND eat IN ('BOTH','DINE_IN')" elseIf (DINE_IN = "false" AND DINE_OUT = "true") Then SQL = SQL & ") AND eat IN ('BOTH','DINE_OUT')" End If set RecordView = Conn.Execute(SQL) Do While Not RecordView.EOF Ername=RecordView("rname") Eeat=RecordView("eat") Ephone=RecordView("phone") Eaddress=RecordView("address") Ecusine=RecordView("cusine") Ehours=RecordView("hours") Especial=RecordView("special") Eaddition1=RecordView("addition1") Eaddition2=RecordView("addition2") Ecrew=RecordView("crew") collect =collect & Ername&"," collectaa =collectaa & Eeat&"," collectbb =collectbb & Ephone&"," collectdd =collectdd & Eaddress&"," collect4 =collect4 & Ecusine&"," collectfg =collectfg & Ehours&"," collecthi =collecthi & Especial&"," collect6 =collect6 & Eaddition1&"," collect7 =collect7 & Eaddition2&"," collectuu =collectuu & Ecrew&"," RecordView.MoveNext Loop output="&output="& collect Response.Write output Response.Write "end&" eoutput="eoutput="& collectaa Response.Write eoutput Response.Write "end&" eeoutput="eeoutput="& collectbb Response.Write eeroutput Response.Write "end&" e4output="e4output="& collectdd Response.Write eeoutput Response.Write "end&" e6eoutput="e6eoutput="& collect4 Response.Write eeoutput Response.Write "end&" ea2output="ea2output="& collectfg Response.Write eeoutput Response.Write "end&" eb7output="eb7output="& collecthi Response.Write eeoutput Response.Write "end&" e7output="e7output="& collect6 Response.Write eeoutput Response.Write "end&" e9output="e9output="& collect7 Response.Write eeoutput Response.Write "end&" emoutput="emoutput="& collectuu Response.Write eeoutput Response.Write "end&" Counter = 1 Response.Write "Counter=" & Counter Response.Write "&" RecordView.Close Set RecordView = Nothing Set Conn = Nothing |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| LoadVariables, ASP and POST | donald | Server Side | 3 | 03-16-2005 04:12 PM |
| Problem retriving the correct value from asp file | o_emma | Flash MX 2004 |
1 | 06-17-2004 12:11 AM |
| flash TO asp TO authorize.net TO asp to FLASH | ScotterMonk | Flash MX ActionScript |
0 | 11-06-2003 10:43 PM |
| Flash & ASP | vantan | Server Side | 0 | 10-12-2001 05:50 PM |
| Asp / Php Problems | dannybe2 | Server Side | 12 | 03-24-2001 02:34 PM |

Other Programming



