Ask a Question related to ASP Database, Design and Development.
-
Ray Medina #1
Dynamic Drop Down (SQL and ASp)
I developing this web app for our department, I am using FP2002, SQL
back-end. I have 3 tables in my database at the moment and which it will
grow to about 10-15 tables in 4 months....Now..
In my Webform that I need to create a new record for the "Server Matrix", I
need to pull some info from my tbl_OS and tbl_Staff and I can't seem to be
able to accomplish this. I have seen many many samples but they all lead to
the same problem. It looks like I have something extra in my code...Can
someone help me with this?? The command that is having the problem, ("so I
think") is the <option></option>, there is (I think) an extra "........
<%
Dim DataConn
Dim CmdPopulateOS
Dim SQL
%>
<%
Set DataConn=Server.CreateObject("ADODB.Connection")
Set CmdPopulateOS=Server.CreateObject("ADODB.Recordset ")
%>
<%
DataConn.Open "Driver={SQL
SERVER};Server=SERVERNAME;UID=USER;pwd=password;Da tabase=SACKBA;"
SQL = "SELECT * FROM tbl_OS"
CmdPopulateOS.Open SQL, DataConn
%>
<select size="1" name="OS_Version">
<%while not cmdpopulateOS.eof%>
<option
value="<%=CmdPopulateOS("OS_Version")%>"><%=CmdPop ulateOS("OS_Version")%></o
ption>
<%
CmdPopulateOS.MoveNext
Wend
%>
<%
CmdPopulateOS.Close
Set CmdPopulateOS=Nothing
DataConn.Close
Set DataConn=Nothing
%>
</select>
Ray Medina Guest
-
Dynamic Drop down DDL - One to Many
I am looking for either a way to handcode, or an extension which will allow me to create a dynamic drop down using 3 tables. I have downloaded... -
dynamic drop downlists in an editable dynamic datagrid.
How would we address a situation where we have to put dynamic drop downlists in an editable dynamic datagrid. So the scenario is to populate a... -
Dynamic Drop-Down Menu
I am trying to create a page to edit information previously submitted by the user. I cannot figure out how to pre-select the item that the user... -
Dynamic ASP Drop Down List
Hi, I have created a drop down list which is linked to a dataset. Can anyone tell me how I can display 'Please Select' at the top of the drop down... -
dynamic drop down
Yup, and probably best done in Javascript and not PHP :) someone@somedomain.com.invalid wrote: -- MeerKat -
Ray at #2
Re: Dynamic Drop Down (SQL and ASp)
What isn't working right? Aside from the normal "how do I make my ASP pages
more efficient" things, I don't see anything explicitely wrong. ARe you
getting an error? Are you getting something unexpected? If so, what? What
do you expect instead? What is appearing as extra? Oh, I see, you think
there's an extra ".
This line:
<option
value="<%=CmdPopulateOS("OS_Version")%>"><%=CmdPop ulateOS("OS_Version")%></o
ption>
should show up like this in a view-source:
<option value="The value">The Option</option>
That's fine. Do your values have " in them, by chance?
<option
value="<%=SafeOut(CmdPopulateOS("OS_Version"))%>"> <%=SafeOut(CmdPopulateOS("
OS_Version"))%></option>
<%
Function SafeOut(theString)
SafeOut = Replace(theString, """", """)
End Function
%>
Ray at work
"Ray Medina" <compuex@bellsouth.net> wrote in message
news:uZtTOTH4DHA.416@TK2MSFTNGP10.phx.gbl...I> I developing this web app for our department, I am using FP2002, SQL
> back-end. I have 3 tables in my database at the moment and which it will
> grow to about 10-15 tables in 4 months....Now..
>
> In my Webform that I need to create a new record for the "Server Matrix",to> need to pull some info from my tbl_OS and tbl_Staff and I can't seem to be
> able to accomplish this. I have seen many many samples but they all leadvalue="<%=CmdPopulateOS("OS_Version")%>"><%=CmdPop ulateOS("OS_Version")%></o> the same problem. It looks like I have something extra in my code...Can
> someone help me with this?? The command that is having the problem, ("so I
> think") is the <option></option>, there is (I think) an extra "........
>
>
> <%
> Dim DataConn
> Dim CmdPopulateOS
> Dim SQL
> %>
> <%
> Set DataConn=Server.CreateObject("ADODB.Connection")
> Set CmdPopulateOS=Server.CreateObject("ADODB.Recordset ")
> %>
> <%
> DataConn.Open "Driver={SQL
> SERVER};Server=SERVERNAME;UID=USER;pwd=password;Da tabase=SACKBA;"
>
> SQL = "SELECT * FROM tbl_OS"
> CmdPopulateOS.Open SQL, DataConn
> %>
>
> <select size="1" name="OS_Version">
> <%while not cmdpopulateOS.eof%>
> <option
>> ption>
> <%
> CmdPopulateOS.MoveNext
> Wend
> %>
> <%
> CmdPopulateOS.Close
> Set CmdPopulateOS=Nothing
> DataConn.Close
> Set DataConn=Nothing
> %>
> </select>
>
>
Ray at Guest
-
Ray Medina #3
Re: Dynamic Drop Down (SQL and ASp)
Ray...thanks for your quick response...but still does not work.
When I see my page, I get a " in the dropdown and none of my data is
populating the dropdown. That is the only error I am getting.
Is there any other way to accomplish this...?
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:OTIfRbH4DHA.4084@TK2MSFTNGP11.phx.gbl...pages> What isn't working right? Aside from the normal "how do I make my ASPWhat> more efficient" things, I don't see anything explicitely wrong. ARe you
> getting an error? Are you getting something unexpected? If so, what?value="<%=CmdPopulateOS("OS_Version")%>"><%=CmdPop ulateOS("OS_Version")%></o> do you expect instead? What is appearing as extra? Oh, I see, you think
> there's an extra ".
>
> This line:
> <option
>value="<%=SafeOut(CmdPopulateOS("OS_Version"))%>"> <%=SafeOut(CmdPopulateOS("> ption>
>
> should show up like this in a view-source:
>
> <option value="The value">The Option</option>
>
> That's fine. Do your values have " in them, by chance?
>
>
> <option
>will> OS_Version"))%></option>
>
>
> <%
>
> Function SafeOut(theString)
> SafeOut = Replace(theString, """", """)
> End Function
>
> %>
>
> Ray at work
>
>
>
> "Ray Medina" <compuex@bellsouth.net> wrote in message
> news:uZtTOTH4DHA.416@TK2MSFTNGP10.phx.gbl...> > I developing this web app for our department, I am using FP2002, SQL
> > back-end. I have 3 tables in my database at the moment and which itMatrix",> > grow to about 10-15 tables in 4 months....Now..
> >
> > In my Webform that I need to create a new record for the "Serverbe> I> > need to pull some info from my tbl_OS and tbl_Staff and I can't seem toI> to> > able to accomplish this. I have seen many many samples but they all lead> > the same problem. It looks like I have something extra in my code...Can
> > someone help me with this?? The command that is having the problem, ("sovalue="<%=CmdPopulateOS("OS_Version")%>"><%=CmdPop ulateOS("OS_Version")%></o>> > think") is the <option></option>, there is (I think) an extra "........
> >
> >
> > <%
> > Dim DataConn
> > Dim CmdPopulateOS
> > Dim SQL
> > %>
> > <%
> > Set DataConn=Server.CreateObject("ADODB.Connection")
> > Set CmdPopulateOS=Server.CreateObject("ADODB.Recordset ")
> > %>
> > <%
> > DataConn.Open "Driver={SQL
> > SERVER};Server=SERVERNAME;UID=USER;pwd=password;Da tabase=SACKBA;"
> >
> > SQL = "SELECT * FROM tbl_OS"
> > CmdPopulateOS.Open SQL, DataConn
> > %>
> >
> > <select size="1" name="OS_Version">
> > <%while not cmdpopulateOS.eof%>
> > <option
> >>> > ption>
> > <%
> > CmdPopulateOS.MoveNext
> > Wend
> > %>
> > <%
> > CmdPopulateOS.Close
> > Set CmdPopulateOS=Nothing
> > DataConn.Close
> > Set DataConn=Nothing
> > %>
> > </select>
> >
> >
>
Ray Medina Guest
-
Ken Schaefer #4
Re: Dynamic Drop Down (SQL and ASp)
Change the following two lines:
to be:> > SQL = "SELECT * FROM tbl_OS"
> > CmdPopulateOS.Open SQL, DataConn
<%
SQL = "SELECT * FROM tbl_OS"
CmdPopulateOS.Open SQL, DataConn
If CmdPopulateOS.Open.EOF then
Response.Write("There are not records in the recordset")
End If
%>
Cheers
Ken
"Ray Medina" <compuex@bellsouth.net> wrote in message
news:OVrMygH4DHA.1428@TK2MSFTNGP12.phx.gbl...
: Ray...thanks for your quick response...but still does not work.
:
: When I see my page, I get a " in the dropdown and none of my data is
: populating the dropdown. That is the only error I am getting.
:
: Is there any other way to accomplish this...?
:
:
:
:
: "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
: news:OTIfRbH4DHA.4084@TK2MSFTNGP11.phx.gbl...
: > What isn't working right? Aside from the normal "how do I make my ASP
: pages
: > more efficient" things, I don't see anything explicitely wrong. ARe you
: > getting an error? Are you getting something unexpected? If so, what?
: What
: > do you expect instead? What is appearing as extra? Oh, I see, you
think
: > there's an extra ".
: >
: > This line:
: > <option
: >
:
value="<%=CmdPopulateOS("OS_Version")%>"><%=CmdPop ulateOS("OS_Version")%></o
: > ption>
: >
: > should show up like this in a view-source:
: >
: > <option value="The value">The Option</option>
: >
: > That's fine. Do your values have " in them, by chance?
: >
: >
: > <option
: >
:
value="<%=SafeOut(CmdPopulateOS("OS_Version"))%>"> <%=SafeOut(CmdPopulateOS("
: > OS_Version"))%></option>
: >
: >
: > <%
: >
: > Function SafeOut(theString)
: > SafeOut = Replace(theString, """", """)
: > End Function
: >
: > %>
: >
: > Ray at work
: >
: >
: >
: > "Ray Medina" <compuex@bellsouth.net> wrote in message
: > news:uZtTOTH4DHA.416@TK2MSFTNGP10.phx.gbl...
: > > I developing this web app for our department, I am using FP2002, SQL
: > > back-end. I have 3 tables in my database at the moment and which it
: will
: > > grow to about 10-15 tables in 4 months....Now..
: > >
: > > In my Webform that I need to create a new record for the "Server
: Matrix",
: > I
: > > need to pull some info from my tbl_OS and tbl_Staff and I can't seem
to
: be
: > > able to accomplish this. I have seen many many samples but they all
lead
: > to
: > > the same problem. It looks like I have something extra in my
code...Can
: > > someone help me with this?? The command that is having the problem,
("so
: I
: > > think") is the <option></option>, there is (I think) an extra
"........
: > >
: > >
: > > <%
: > > Dim DataConn
: > > Dim CmdPopulateOS
: > > Dim SQL
: > > %>
: > > <%
: > > Set DataConn=Server.CreateObject("ADODB.Connection")
: > > Set CmdPopulateOS=Server.CreateObject("ADODB.Recordset ")
: > > %>
: > > <%
: > > DataConn.Open "Driver={SQL
: > > SERVER};Server=SERVERNAME;UID=USER;pwd=password;Da tabase=SACKBA;"
: > >
: > > SQL = "SELECT * FROM tbl_OS"
: > > CmdPopulateOS.Open SQL, DataConn
: > > %>
: > >
: > > <select size="1" name="OS_Version">
: > > <%while not cmdpopulateOS.eof%>
: > > <option
: > >
: >
:
value="<%=CmdPopulateOS("OS_Version")%>"><%=CmdPop ulateOS("OS_Version")%></o
: > > ption>
: > > <%
: > > CmdPopulateOS.MoveNext
: > > Wend
: > > %>
: > > <%
: > > CmdPopulateOS.Close
: > > Set CmdPopulateOS=Nothing
: > > DataConn.Close
: > > Set DataConn=Nothing
: > > %>
: > > </select>
: > >
: > >
: >
: >
:
:
Ken Schaefer Guest
-
Ray Medina #5
Re: Dynamic Drop Down (SQL and ASp)
This problem is closed now...
"Ray Medina" <compuex@bellsouth.net> wrote in message
news:OVrMygH4DHA.1428@TK2MSFTNGP12.phx.gbl...think> Ray...thanks for your quick response...but still does not work.
>
> When I see my page, I get a " in the dropdown and none of my data is
> populating the dropdown. That is the only error I am getting.
>
> Is there any other way to accomplish this...?
>
>
>
>
> "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
> news:OTIfRbH4DHA.4084@TK2MSFTNGP11.phx.gbl...> pages> > What isn't working right? Aside from the normal "how do I make my ASP> What> > more efficient" things, I don't see anything explicitely wrong. ARe you
> > getting an error? Are you getting something unexpected? If so, what?> > do you expect instead? What is appearing as extra? Oh, I see, youvalue="<%=CmdPopulateOS("OS_Version")%>"><%=CmdPop ulateOS("OS_Version")%></o>> > there's an extra ".
> >
> > This line:
> > <option
> >value="<%=SafeOut(CmdPopulateOS("OS_Version"))%>"> <%=SafeOut(CmdPopulateOS(">> > ption>
> >
> > should show up like this in a view-source:
> >
> > <option value="The value">The Option</option>
> >
> > That's fine. Do your values have " in them, by chance?
> >
> >
> > <option
> >to> will> > OS_Version"))%></option>
> >
> >
> > <%
> >
> > Function SafeOut(theString)
> > SafeOut = Replace(theString, """", """)
> > End Function
> >
> > %>
> >
> > Ray at work
> >
> >
> >
> > "Ray Medina" <compuex@bellsouth.net> wrote in message
> > news:uZtTOTH4DHA.416@TK2MSFTNGP10.phx.gbl...> > > I developing this web app for our department, I am using FP2002, SQL
> > > back-end. I have 3 tables in my database at the moment and which it> Matrix",> > > grow to about 10-15 tables in 4 months....Now..
> > >
> > > In my Webform that I need to create a new record for the "Server> > I> > > need to pull some info from my tbl_OS and tbl_Staff and I can't seemlead> be> > > able to accomplish this. I have seen many many samples but they allcode...Can> > to> > > the same problem. It looks like I have something extra in my("so> > > someone help me with this?? The command that is having the problem,"........> I> > > think") is the <option></option>, there is (I think) an extravalue="<%=CmdPopulateOS("OS_Version")%>"><%=CmdPop ulateOS("OS_Version")%></o>> >> > >
> > >
> > > <%
> > > Dim DataConn
> > > Dim CmdPopulateOS
> > > Dim SQL
> > > %>
> > > <%
> > > Set DataConn=Server.CreateObject("ADODB.Connection")
> > > Set CmdPopulateOS=Server.CreateObject("ADODB.Recordset ")
> > > %>
> > > <%
> > > DataConn.Open "Driver={SQL
> > > SERVER};Server=SERVERNAME;UID=USER;pwd=password;Da tabase=SACKBA;"
> > >
> > > SQL = "SELECT * FROM tbl_OS"
> > > CmdPopulateOS.Open SQL, DataConn
> > > %>
> > >
> > > <select size="1" name="OS_Version">
> > > <%while not cmdpopulateOS.eof%>
> > > <option
> > >>> >> > > ption>
> > > <%
> > > CmdPopulateOS.MoveNext
> > > Wend
> > > %>
> > > <%
> > > CmdPopulateOS.Close
> > > Set CmdPopulateOS=Nothing
> > > DataConn.Close
> > > Set DataConn=Nothing
> > > %>
> > > </select>
> > >
> > >
> >
>
Ray Medina Guest



Reply With Quote

