<% fp_sQry="SELECT * FROM eqtable ORDER BY category" fp_sDefault="" fp_sNoRecords="No records returned." fp_sDataConn="Inventory" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=False fp_fMenuFormat=True fp_sMenuChoice="Category" fp_sMenuValue="Category" fp_iDisplayCols=1 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %>

<% fp_sQry="SELECT Name FROM " & Category & " ORDER BY Name" fp_sDefault="" fp_sNoRecords="No records returned." fp_sDataConn="Inventory" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=False fp_fMenuFormat=True fp_sMenuChoice="Sub_Category" fp_sMenuValue="Sub_Category" fp_iDisplayCols=1 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %> <% IF Request.Form("Category") = "" Then Else %>

">
<%End IF%> [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <5039f16b.0410120711.6383d8a3@posting.google.com> [ref] => [htmlstate] => on_nl2br [postusername] => Tim [ip] => tghetti@targete [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> <% > fp_sQry="SELECT * FROM eqtable ORDER BY category" > fp_sDefault="" > fp_sNoRecords="No records returned." > fp_sDataConn="Inventory" > fp_iMaxRecords=256 > fp_iCommandType=1 > fp_iPageSize=0 > fp_fTableFormat=False > fp_fMenuFormat=True > fp_sMenuChoice="Category" > fp_sMenuValue="Category" > fp_iDisplayCols=1 > fp_fCustomQuery=False > BOTID=0 > fp_iRegion=BOTID > %> > > >

> > >
> >

<% > fp_sQry="SELECT Name FROM " & Category & " ORDER BY Name" > fp_sDefault="" > fp_sNoRecords="No records returned." > fp_sDataConn="Inventory" > fp_iMaxRecords=256 > fp_iCommandType=1 > fp_iPageSize=0 > fp_fTableFormat=False > fp_fMenuFormat=True > fp_sMenuChoice="Sub_Category" > fp_sMenuValue="Sub_Category" > fp_iDisplayCols=1 > fp_fCustomQuery=False > BOTID=0 > fp_iRegion=BOTID > %> > <% > IF Request.Form("Category") = "" Then > Else > %> > >

> "> >
> <%End IF%>[/ref] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => <5039f16b.0410120711.6383d8a3@posting.google.com> [htmlstate] => on_nl2br [postusername] => Aaron [ip] => ten.xoc@dnartre [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> <% fp_sQry="SELECT * FROM eqtable ORDER BY category" fp_sDefault="" fp_sNoRecords="No records returned." fp_sDataConn="Inventory" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=False fp_fMenuFormat=True fp_sMenuChoice="Category" fp_sMenuValue="Category" fp_iDisplayCols=1 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %>

<% fp_sQry="SELECT Name FROM " & Category & " ORDER BY Name" fp_sDefault="" fp_sNoRecords="No records returned." fp_sDataConn="Inventory" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=False fp_fMenuFormat=True fp_sMenuChoice="Sub_Category" fp_sMenuValue="Sub_Category" fp_iDisplayCols=1 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %> <% IF Request.Form("Category") = "" Then Else %>

">
<%End IF%> [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <5039f16b.0410121955.3c3d415a@posting.google.com> [ref] => [htmlstate] => on_nl2br [postusername] => Tim [ip] => tghetti@targete [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> use a variable for -table selection- in my ASP SQL statement - ASP Database

use a variable for -table selection- in my ASP SQL statement - ASP Database

Hi All, I have a small issue that I can't seem to figure out. I have a SQL statement that is dependant on the results of a drop down to chose which table to select from. Unfortunately it does not seem to work. Could anyone point me in the right direction? Unfortunately the datebase cannot be changed. I guess my question is this. Is it possible to use a variable in a SQl select statement to choose the table? If so, where is my syntax bad. If not, how can i get around this without changing the database Thanks in ...

  1. #1

    Default use a variable for -table selection- in my ASP SQL statement

    Hi All,
    I have a small issue that I can't seem to figure out. I have a SQL
    statement that is dependant on the results of a drop down to chose
    which table to select from. Unfortunately it does not seem to work.
    Could anyone point me in the right direction? Unfortunately the
    datebase cannot be changed.

    I guess my question is this. Is it possible to use a variable in a SQl
    select statement to choose the table? If so, where is my syntax bad.
    If not, how can i get around this without changing the database

    Thanks in advance!


    *** here's some of the code!!

    <form method="POST" name="Form1" action="test1.asp">

    <p><nobr><!--#include file="../_fpclass/fpdblib.inc"--> <%
    fp_sQry="SELECT * FROM eqtable ORDER BY category"
    fp_sDefault=""
    fp_sNoRecords="No records returned."
    fp_sDataConn="Inventory"
    fp_iMaxRecords=256
    fp_iCommandType=1
    fp_iPageSize=0
    fp_fTableFormat=False
    fp_fMenuFormat=True
    fp_sMenuChoice="Category"
    fp_sMenuValue="Category"
    fp_iDisplayCols=1
    fp_fCustomQuery=False
    BOTID=0
    fp_iRegion=BOTID
    %>

    <select NAME="Category" SIZE="1" ONCHANGE=Form1.submit()> <option
    selected><%=Request.Form("Category")%></option>
    <!--#include file="../_fpclass/fpdbrgn1.inc"-->
    <option><%=FP_FieldHTML(fp_rs,"Category")%></option>
    <!--#include file="../_fpclass/fpdbrgn2.inc"-->
    </select>
    </nobr></p>
    </form>

    <form method="POST" name="Form2" action="YourPage2.asp">

    <p><nobr><!--#include file="../_fpclass/fpdblib.inc"--> <%
    fp_sQry="SELECT Name FROM " & Category & " ORDER BY Name"
    fp_sDefault=""
    fp_sNoRecords="No records returned."
    fp_sDataConn="Inventory"
    fp_iMaxRecords=256
    fp_iCommandType=1
    fp_iPageSize=0
    fp_fTableFormat=False
    fp_fMenuFormat=True
    fp_sMenuChoice="Sub_Category"
    fp_sMenuValue="Sub_Category"
    fp_iDisplayCols=1
    fp_fCustomQuery=False
    BOTID=0
    fp_iRegion=BOTID
    %>
    <%
    IF Request.Form("Category") = "" Then
    Else
    %>
    <select NAME="Sub_Category" SIZE="1" ONCHANGE=Form2.submit()> <option
    selected><%=Request.Form("Sub_Category")%></option>
    <!--#include file="../_fpclass/fpdbrgn1.inc"-->
    <option><%=FP_FieldHTML(fp_rs,"Sub_Category")%></option>
    <!--#include file="../_fpclass/fpdbrgn2.inc"-->
    </select>
    </nobr></p>
    <input type="hidden" name="Category" value="<% =
    Request.Form("Category") %>">
    </form>
    <%End IF%>
    Tim Guest

  2. #2

    Default Re: use a variable for -table selection- in my ASP SQL statement

    http://www.aspfaq.com/5003

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Tim" <com> wrote in message
    news:google.com... 


    Aaron Guest

  3. #3

    Default use a variable for -table selection- in my ASP SQL statement

    Hi All,
    I have a small issue that I can't seem to figure out. I have a SQL
    statement that is dependant on the results of a drop down to chose
    which table to select from. Unfortunately it does not seem to work.
    Could anyone point me in the right direction? Unfortunately the
    datebase cannot be changed.

    I guess my question is this. Is it possible to use a variable in a SQl
    select statement to choose the table? If so, where is my syntax bad.
    If not, how can i get around this without changing the database

    Thanks in advance!


    *** here's some of the code!!

    <form method="POST" name="Form1" action="test1.asp">

    <p><nobr><!--#include file="../_fpclass/fpdblib.inc"--> <%
    fp_sQry="SELECT * FROM eqtable ORDER BY category"
    fp_sDefault=""
    fp_sNoRecords="No records returned."
    fp_sDataConn="Inventory"
    fp_iMaxRecords=256
    fp_iCommandType=1
    fp_iPageSize=0
    fp_fTableFormat=False
    fp_fMenuFormat=True
    fp_sMenuChoice="Category"
    fp_sMenuValue="Category"
    fp_iDisplayCols=1
    fp_fCustomQuery=False
    BOTID=0
    fp_iRegion=BOTID
    %>

    <select NAME="Category" SIZE="1" ONCHANGE=Form1.submit()> <option
    selected><%=Request.Form("Category")%></option>
    <!--#include file="../_fpclass/fpdbrgn1.inc"-->
    <option><%=FP_FieldHTML(fp_rs,"Category")%></option>
    <!--#include file="../_fpclass/fpdbrgn2.inc"-->
    </select>
    </nobr></p>
    </form>

    <form method="POST" name="Form2" action="YourPage2.asp">

    <p><nobr><!--#include file="../_fpclass/fpdblib.inc"--> <%
    fp_sQry="SELECT Name FROM " & Category & " ORDER BY Name"
    fp_sDefault=""
    fp_sNoRecords="No records returned."
    fp_sDataConn="Inventory"
    fp_iMaxRecords=256
    fp_iCommandType=1
    fp_iPageSize=0
    fp_fTableFormat=False
    fp_fMenuFormat=True
    fp_sMenuChoice="Sub_Category"
    fp_sMenuValue="Sub_Category"
    fp_iDisplayCols=1
    fp_fCustomQuery=False
    BOTID=0
    fp_iRegion=BOTID
    %>
    <%
    IF Request.Form("Category") = "" Then
    Else
    %>
    <select NAME="Sub_Category" SIZE="1" ONCHANGE=Form2.submit()> <option
    selected><%=Request.Form("Sub_Category")%></option>
    <!--#include file="../_fpclass/fpdbrgn1.inc"-->
    <option><%=FP_FieldHTML(fp_rs,"Sub_Category")%></option>
    <!--#include file="../_fpclass/fpdbrgn2.inc"-->
    </select>
    </nobr></p>
    <input type="hidden" name="Category" value="<% =
    Request.Form("Category") %>">
    </form>
    <%End IF%>
    Tim Guest

Similar Threads

  1. A variable in a php statement
    By sjmyles in forum Dreamweaver AppDev
    Replies: 3
    Last Post: February 23rd, 09:42 AM
  2. Replies: 0
    Last Post: July 23rd, 11:30 PM
  3. Replies: 1
    Last Post: September 15th, 05:46 PM
  4. Multiple selection + table
    By Lori Costache in forum PHP Development
    Replies: 3
    Last Post: July 28th, 05:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139