simple (?) connection problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ray at

    #16
    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]


    Comment

    • middletree

      #17
      Re: simple (?) connection problem

      I'll do that when I get home (it's for a chruch thing I'm working on at
      home, so I don't have the files here)

      thanks


      "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
      news:#hKGoobvDH A.3536@tk2msftn gp13.phx.gbl...[color=blue]
      > <%
      > '''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=green]
      > > Yes.
      > >
      > >
      > > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
      > > news:e6yoZdbvDH A.2408@tk2msftn gp13.phx.gbl...[color=darkred]
      > > > Are you still getting an error with the "set rs=" line after[/color][/color][/color]
      correcting[color=blue][color=green]
      > > the[color=darkred]
      > > > name of your connection object?
      > > >
      > > > Ray at home
      > > >
      > > > "middletree " <middletree@hto mail.com> wrote in message
      > > > news:%23FTDWGav DHA.2440@TK2MSF TNGP12.phx.gbl. ..
      > > > > Sorry.
      > > > >
      > > > > SELECT GiftID, GiftDesc
      > > > > FROM Gift
      > > > > ORDER BY GiftDesc
      > > > >
      > > > >
      > > > >
      > > > >
      > > > >
      > > > >
      > > > > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in[/color][/color]
      > message[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
      > > > message
      > > > > > > 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[/color][/color][/color]
      range,[color=blue]
      > or[color=green][color=darkred]
      > > > are
      > > > > > in
      > > > > > > > > conflict with one another.
      > > > > > > > > /grace/shape.asp, line 117
      > > > > > > > >
      > > > > > > > >
      > > > > > > > > Where 117 is:
      > > > > > > > > RS.Open strSQL, conn
      > > > > > > > >
      > > > > > > > >
      > > > > > > >
      > > > > > > >
      > > > > > >
      > > > > > >
      > > > > >
      > > > > >
      > > > >
      > > > >
      > > >
      > > >[/color]
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • middletree

        #18
        Re: simple (?) connection problem

        Well, I got it to work, but only by putting all the code into the same page.
        When I had the top part in an include file, it gave me the object required
        error. Not sure why. I am 100% sure that the code pointing to the include
        file was correct.

        Oh well, this thing is only going to have 3-4 pages anyway, so it's not that
        big a deal to have the include for the connection.

        thanks


        "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
        news:#hKGoobvDH A.3536@tk2msftn gp13.phx.gbl...[color=blue]
        > <%
        > '''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=green]
        > > Yes.
        > >
        > >
        > > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
        > > news:e6yoZdbvDH A.2408@tk2msftn gp13.phx.gbl...[color=darkred]
        > > > Are you still getting an error with the "set rs=" line after[/color][/color][/color]
        correcting[color=blue][color=green]
        > > the[color=darkred]
        > > > name of your connection object?
        > > >
        > > > Ray at home
        > > >
        > > > "middletree " <middletree@hto mail.com> wrote in message
        > > > news:%23FTDWGav DHA.2440@TK2MSF TNGP12.phx.gbl. ..
        > > > > Sorry.
        > > > >
        > > > > SELECT GiftID, GiftDesc
        > > > > FROM Gift
        > > > > ORDER BY GiftDesc
        > > > >
        > > > >
        > > > >
        > > > >
        > > > >
        > > > >
        > > > > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in[/color][/color]
        > message[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
        > > > message
        > > > > > > 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[/color][/color][/color]
        range,[color=blue]
        > or[color=green][color=darkred]
        > > > are
        > > > > > in
        > > > > > > > > conflict with one another.
        > > > > > > > > /grace/shape.asp, line 117
        > > > > > > > >
        > > > > > > > >
        > > > > > > > > Where 117 is:
        > > > > > > > > RS.Open strSQL, conn
        > > > > > > > >
        > > > > > > > >
        > > > > > > >
        > > > > > > >
        > > > > > >
        > > > > > >
        > > > > >
        > > > > >
        > > > >
        > > > >
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Ray at

          #19
          Re: simple (?) connection problem

          Is that code in a Sub? If so, did you call it? Also, did you correct the
          incosistency between your object naming? ("conn" in your include and
          "objconnect ion" in your page)

          Ray at work

          "middletree " <middletree@hto mail.com> wrote in message
          news:OyQ484gvDH A.3116@tk2msftn gp13.phx.gbl...[color=blue]
          > Well, I got it to work, but only by putting all the code into the same[/color]
          page.[color=blue]
          > When I had the top part in an include file, it gave me the object required
          > error. Not sure why. I am 100% sure that the code pointing to the include
          > file was correct.
          >
          > Oh well, this thing is only going to have 3-4 pages anyway, so it's not[/color]
          that[color=blue]
          > big a deal to have the include for the connection.
          >
          > thanks[/color]


          Comment

          Working...