Re: simple (?) connection problem
<%
'''from the include
cst = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source="
cst = cst & server.mappath( "shape.mdb" )
set conn = Server.CreateOb ject("ADODB.Con nection")
conn.open cst
%>
<select name="Gift1" id="Gift1">
<option value="" selected>-Select One-</option>
<%
strSQL = "SELECT GiftID, GiftDesc "
strSQL = strSQL & "FROM Gift "
strSQL = strSQL & "ORDER BY GiftDesc"
set rs = conn.execute(st rSQL)
While Not RS.EOF
Response.Write "<option value=""" & rs.Fields.Item( 0).Value & """>" &
rs.Fields.Item( 1).Value & "</option>"
RS.MoveNext
WEND
RS.Close
set RS = nothing
%>
</select>
Assuming that you have columns named GiftID and GiftDesc in a table named
Gift, this code above should work. Give it a try.
Ray at home
"middletree " <middletree@hto mail.com> wrote in message
news:OIK8QibvDH A.3144@tk2msftn gp13.phx.gbl...[color=blue]
> Yes.
>
>
> "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
> news:e6yoZdbvDH A.2408@tk2msftn gp13.phx.gbl...[color=green]
> > Are you still getting an error with the "set rs=" line after correcting[/color]
> the[color=green]
> > name of your connection object?
> >
> > Ray at home
> >
> > "middletree " <middletree@hto mail.com> wrote in message
> > news:%23FTDWGav DHA.2440@TK2MSF TNGP12.phx.gbl. ..[color=darkred]
> > > Sorry.
> > >
> > > SELECT GiftID, GiftDesc
> > > FROM Gift
> > > ORDER BY GiftDesc
> > >
> > >
> > >
> > >
> > >
> > >
> > > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in[/color][/color][/color]
message[color=blue][color=green][color=darkred]
> > > news:uDAsyxUvDH A.2260@TK2MSFTN GP09.phx.gbl...
> > > > Would you like to share that select statement?
> > > >
> > > > Ray at home
> > > >
> > > > "middletree " <middletree@hto mail.com> wrote in message
> > > > news:ueC10vUvDH A.3196@TK2MSFTN GP11.phx.gbl...
> > > > > It shows exactly what you'd think: The Select statement
> > > > >
> > > > >
> > > > > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in[/color]
> > message[color=darkred]
> > > > > news:#u9K8lUvDH A.2408@tk2msftn gp13.phx.gbl...
> > > > > > What does
> > > > > > RESPONSE.WRITE STRSQL
> > > > > > RESPONSE.END
> > > > > >
> > > > > > show you?
> > > > > >
> > > > > > Or, which line is line 117?
> > > > > >
> > > > > > Ray at home
> > > > > >
> > > > > > "middletree " <middletree@hto mail.com> wrote in message
> > > > > > news:enVbhhUvDH A.3496@TK2MSFTN GP11.phx.gbl...
> > > > > > > Forgot to add., this is the error I get:
> > > > > > >
> > > > > > > Error Type:
> > > > > > > ADODB.Recordset (0x800A0BB9)
> > > > > > > Arguments are of the wrong type, are out of acceptable range,[/color][/color][/color]
or[color=blue][color=green]
> > are[color=darkred]
> > > > in
> > > > > > > conflict with one another.
> > > > > > > /grace/shape.asp, line 117
> > > > > > >
> > > > > > >
> > > > > > > Where 117 is:
> > > > > > > RS.Open strSQL, conn
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]
<%
'''from the include
cst = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source="
cst = cst & server.mappath( "shape.mdb" )
set conn = Server.CreateOb ject("ADODB.Con nection")
conn.open cst
%>
<select name="Gift1" id="Gift1">
<option value="" selected>-Select One-</option>
<%
strSQL = "SELECT GiftID, GiftDesc "
strSQL = strSQL & "FROM Gift "
strSQL = strSQL & "ORDER BY GiftDesc"
set rs = conn.execute(st rSQL)
While Not RS.EOF
Response.Write "<option value=""" & rs.Fields.Item( 0).Value & """>" &
rs.Fields.Item( 1).Value & "</option>"
RS.MoveNext
WEND
RS.Close
set RS = nothing
%>
</select>
Assuming that you have columns named GiftID and GiftDesc in a table named
Gift, this code above should work. Give it a try.
Ray at home
"middletree " <middletree@hto mail.com> wrote in message
news:OIK8QibvDH A.3144@tk2msftn gp13.phx.gbl...[color=blue]
> Yes.
>
>
> "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
> news:e6yoZdbvDH A.2408@tk2msftn gp13.phx.gbl...[color=green]
> > Are you still getting an error with the "set rs=" line after correcting[/color]
> the[color=green]
> > name of your connection object?
> >
> > Ray at home
> >
> > "middletree " <middletree@hto mail.com> wrote in message
> > news:%23FTDWGav DHA.2440@TK2MSF TNGP12.phx.gbl. ..[color=darkred]
> > > Sorry.
> > >
> > > SELECT GiftID, GiftDesc
> > > FROM Gift
> > > ORDER BY GiftDesc
> > >
> > >
> > >
> > >
> > >
> > >
> > > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in[/color][/color][/color]
message[color=blue][color=green][color=darkred]
> > > news:uDAsyxUvDH A.2260@TK2MSFTN GP09.phx.gbl...
> > > > Would you like to share that select statement?
> > > >
> > > > Ray at home
> > > >
> > > > "middletree " <middletree@hto mail.com> wrote in message
> > > > news:ueC10vUvDH A.3196@TK2MSFTN GP11.phx.gbl...
> > > > > It shows exactly what you'd think: The Select statement
> > > > >
> > > > >
> > > > > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in[/color]
> > message[color=darkred]
> > > > > news:#u9K8lUvDH A.2408@tk2msftn gp13.phx.gbl...
> > > > > > What does
> > > > > > RESPONSE.WRITE STRSQL
> > > > > > RESPONSE.END
> > > > > >
> > > > > > show you?
> > > > > >
> > > > > > Or, which line is line 117?
> > > > > >
> > > > > > Ray at home
> > > > > >
> > > > > > "middletree " <middletree@hto mail.com> wrote in message
> > > > > > news:enVbhhUvDH A.3496@TK2MSFTN GP11.phx.gbl...
> > > > > > > Forgot to add., this is the error I get:
> > > > > > >
> > > > > > > Error Type:
> > > > > > > ADODB.Recordset (0x800A0BB9)
> > > > > > > Arguments are of the wrong type, are out of acceptable range,[/color][/color][/color]
or[color=blue][color=green]
> > are[color=darkred]
> > > > in
> > > > > > > conflict with one another.
> > > > > > > /grace/shape.asp, line 117
> > > > > > >
> > > > > > >
> > > > > > > Where 117 is:
> > > > > > > RS.Open strSQL, conn
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]
Comment