Ask a Question related to ASP Database, Design and Development.
-
Darby #1
Passing db values to function
Hello,
I am creating dynamic images with corresponding checkboxes by pulling
data from an Access database. The onchange event of the checkboxes
calls a javascript function which basically stores the image name
taken from the database into an array. Unfortunately I am having a
problem doing this the way I would like. I have no problem passing
the primary key from the Access database (IDNum), which is an
autonumber, but I am unable to pass the name of the image (Name) which
I have designated as a text data type. I get an error message telling
me the value I am trying to pass is undefined. I would appreciate any
help on this.
Dim connCW, strQuery, rsItem, counter
'Create and open the database connection object
Set connCW = Server.CreateObject("ADODB.Connection")
connCW.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("../db/Library.mdb")
SET rsItem = connCW.Execute("SELECT * FROM
"&request.querystring("pres")&" WHERE
Category='"&request.querystring("cat")&"'")
counter=1
Response.write "<table cellpadding=0 cellspacing=0><tr>"
Do While Not rsItem.EOF
Response.Write "<td align=center width=200><a
href=FullView.asp?Slide="&rsItem("Name")&"><img
src=../"&request.querystring("pres")&"/"&request.querystring("cat")&"/Slides/150/"&rsItem("Name")&"
border=0 width=150 height=113></a><br>"
'this DOES NOT work as it is now, but works if I change "Name" to
"IDNum"
Response.Write "<input type=checkbox name="&counter&"
onchange=javascript:checkBoxes("& rsItem("Name") &")></td>"
if counter mod 4=0 then
Response.Write "</tr><tr><td> </td></tr><tr>"
end if
counter=counter+1
rsItem.MoveNext
Loop
response.write "</table>"
connCW.close()
Darby Guest
-
winhttp passing values
Hello, I have the following structure, Form page My Server 2nd server html ---------->My.asp------->2server.asp User can... -
passing through values
Hello i wanna pass through the value model like this <form method="get" action="meeet.htm"> <div align="center">Nummer: <input type="input"... -
Passing a variable to a package function vs. a local function
I'm a bit new to this so please bear with me... I've written a script that uses CGI.pm something like this: use CGI::Carp qw(fatalsToBrowser);... -
VBS file passing values to ASP URL
Hi, I have a VBS file and I would like to call an ASP web page and pass it values in the URL. Is this possible?? Cheers, -
Passing values from one page to another
Hello all, -------------------------------------------- //Page0.php <a href="page1.php?empid=1">Enter</a>... -
Manohar Kamath [MVP] #2
Re: Passing db values to function
Because on the Javascript side, the name is a string - you need to enclose
it in 's. Otherwise, Javascript will think it is a variable you haven't
defined, and hence the error.
Try:
Response.Write "<input type=checkbox name="&counter&"
onchange=javascript:checkBoxes('"& rsItem("Name") & "')></td>"
--
Manohar Kamath
Editor, .netWire
[url]www.dotnetwire.com[/url]
"Darby" <darby_chris@hotmail.com> wrote in message
news:88c20d1b.0408061126.767cd8c8@posting.google.c om...src=../"&request.querystring("pres")&"/"&request.querystring("cat")&"/Slides> Hello,
> I am creating dynamic images with corresponding checkboxes by pulling
> data from an Access database. The onchange event of the checkboxes
> calls a javascript function which basically stores the image name
> taken from the database into an array. Unfortunately I am having a
> problem doing this the way I would like. I have no problem passing
> the primary key from the Access database (IDNum), which is an
> autonumber, but I am unable to pass the name of the image (Name) which
> I have designated as a text data type. I get an error message telling
> me the value I am trying to pass is undefined. I would appreciate any
> help on this.
>
> Dim connCW, strQuery, rsItem, counter
>
> 'Create and open the database connection object
> Set connCW = Server.CreateObject("ADODB.Connection")
> connCW.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
> "DBQ=" & Server.MapPath("../db/Library.mdb")
> SET rsItem = connCW.Execute("SELECT * FROM
> "&request.querystring("pres")&" WHERE
> Category='"&request.querystring("cat")&"'")
>
> counter=1
>
> Response.write "<table cellpadding=0 cellspacing=0><tr>"
> Do While Not rsItem.EOF
>
> Response.Write "<td align=center width=200><a
> href=FullView.asp?Slide="&rsItem("Name")&"><img
>
/150/"&rsItem("Name")&"> border=0 width=150 height=113></a><br>"
>
> 'this DOES NOT work as it is now, but works if I change "Name" to
> "IDNum"
> Response.Write "<input type=checkbox name="&counter&"
> onchange=javascript:checkBoxes("& rsItem("Name") &")></td>"
>
> if counter mod 4=0 then
> Response.Write "</tr><tr><td> </td></tr><tr>"
> end if
> counter=counter+1
> rsItem.MoveNext
> Loop
> response.write "</table>"
>
> connCW.close()
Manohar Kamath [MVP] Guest
-
Darby #3
Re: Passing db values to function
"Manohar Kamath [MVP]" <mkamath@TAKETHISOUTkamath.com> wrote in message news:<O65quEAfEHA.3732@TK2MSFTNGP11.phx.gbl>...
Thanks Manohar, that did it for me.> Because on the Javascript side, the name is a string - you need to enclose
> it in 's. Otherwise, Javascript will think it is a variable you haven't
> defined, and hence the error.
>
> Try:
>
> Response.Write "<input type=checkbox name="&counter&"
> onchange=javascript:checkBoxes('"& rsItem("Name") & "')></td>"
>
>
>
> --
> Manohar Kamath
> Editor, .netWire
> [url]www.dotnetwire.com[/url]
>
>
> "Darby" <darby_chris@hotmail.com> wrote in message
> news:88c20d1b.0408061126.767cd8c8@posting.google.c om...> src=../"&request.querystring("pres")&"/"&request.querystring("cat")&"/Slides> > Hello,
> > I am creating dynamic images with corresponding checkboxes by pulling
> > data from an Access database. The onchange event of the checkboxes
> > calls a javascript function which basically stores the image name
> > taken from the database into an array. Unfortunately I am having a
> > problem doing this the way I would like. I have no problem passing
> > the primary key from the Access database (IDNum), which is an
> > autonumber, but I am unable to pass the name of the image (Name) which
> > I have designated as a text data type. I get an error message telling
> > me the value I am trying to pass is undefined. I would appreciate any
> > help on this.
> >
> > Dim connCW, strQuery, rsItem, counter
> >
> > 'Create and open the database connection object
> > Set connCW = Server.CreateObject("ADODB.Connection")
> > connCW.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
> > "DBQ=" & Server.MapPath("../db/Library.mdb")
> > SET rsItem = connCW.Execute("SELECT * FROM
> > "&request.querystring("pres")&" WHERE
> > Category='"&request.querystring("cat")&"'")
> >
> > counter=1
> >
> > Response.write "<table cellpadding=0 cellspacing=0><tr>"
> > Do While Not rsItem.EOF
> >
> > Response.Write "<td align=center width=200><a
> > href=FullView.asp?Slide="&rsItem("Name")&"><img
> >
> /150/"&rsItem("Name")&"> > border=0 width=150 height=113></a><br>"
> >
> > 'this DOES NOT work as it is now, but works if I change "Name" to
> > "IDNum"
> > Response.Write "<input type=checkbox name="&counter&"
> > onchange=javascript:checkBoxes("& rsItem("Name") &")></td>"
> >
> > if counter mod 4=0 then
> > Response.Write "</tr><tr><td> </td></tr><tr>"
> > end if
> > counter=counter+1
> > rsItem.MoveNext
> > Loop
> > response.write "</table>"
> >
> > connCW.close()
Chris.
Darby Guest



Reply With Quote

