Displaying asp table in different format not working

Discussion in 'ASP General' started by Jack, Jan 17, 2006.

  1. Jack

    Jack Guest

    Hi,
    I have the following Access DDL statment from which I generated a access
    table:
    CREATE TABLE TEST1
    (ID COUNTER,
    NAME TEXT(50),
    STORAGESPACEASSIGNED TEXT(50)
    )


    INSERT INTO test1 ( Name, StorageSpaceAssigned )
    VALUES ("John Doe", "Kitchen Cabinet");

    INSERT INTO test1 ( Name, StorageSpaceAssigned )
    VALUES ("Jane Doe", "Apartment's Attic");

    INSERT INTO test1 ( Name, StorageSpaceAssigned )
    VALUES ("Sam Hugh", "Bedroom Cabinet");

    INSERT INTO test1 ( Name, StorageSpaceAssigned )
    VALUES ("Tom Jones", "Dining Room's Closet");

    INSERT INTO test1 ( Name, StorageSpaceAssigned )
    VALUES ("Erica James", "None");

    Now I would like to test a asp page using the above data. Here I would like
    to display all the rows containing the fields "name" and
    "StorageSpaceAssigned". I would like to display the same table twice but in
    different format. The first one is a display only table of the above
    specification while the latter table should show each of the cells as text
    box (otherwise the display would be same as the first table).

    The following is the code to generate the two similar tables in a asp page.
    CODE:
    <% 'The following is code for connecting to the database
    myDSN="Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=C:\test.mdb"



    set CN=server.createobject("ADODB.Connection")
    set rs=server.createobject("ADODB.Recordset")
    set rstemp=server.createobject("ADODB.Recordset")

    CN.Open myDSN

    rstemp.ActiveConnection = CN
    rs.ActiveConnection = CN
    %>

    <%

    i = 0

    sql01 = "SELECT * from tblTest "

    rstemp.open sql01

    Response.Write "<TABLE BORDER=1>"
    Do while not rstemp.EOF
    Response.Write "<TR><TD>" & rstemp("Name") & "&nbsp;</TD>"
    Response.Write "<TD>" & rstemp("StorageSpaceAssigned") &
    "&nbsp;</TD></TR>"
    rstemp.MoveNext
    Loop
    Response.Write "</TABLE>"
    rstemp.Close

    'Response.End

    rstemp.Open sql01




    Do until rstemp.eof

    i = i + 1
    response.write "<TR>" & vbCRLF
    strLink = "<TD WIDTH=1% ><INPUT TYPE='HIDDEN' NAME='ID_" & i & "'
    VALUE=" & rstemp("ID") & "></TD>" & vbCRLF
    response.write strLink & vbCRLF

    strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=10
    NAME='name_" & i & "' VALUE='" & rstemp("Name") & "'></TD>" & vbCRLF
    response.write strLink & vbCRLF

    strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=15
    NAME='storagespacesssigned_" & i & "' VALUE='" &
    rstemp("StorageSpaceAssigned") & "'></TD>" & vbCRLF
    response.write strLink & vbCRLF


    response.write strLink & vbCRLF

    response.write "</TR>" & vbCRLF


    rstemp.movenext

    loop
    rstemp.close
    %>


    However, the display of the second table is not coming in the same table
    format as the first and rather is screwed up. I would like to get an input as
    to why this display is getting screwed up. Thanks for any help.
     
    Jack, Jan 17, 2006
    #1
    1. Advertising

  2. Jack

    Paxton Guest

    Jack wrote:
    > Hi,
    > I have the following Access DDL statment from which I generated a access
    > table:
    > CREATE TABLE TEST1
    > (ID COUNTER,
    > NAME TEXT(50),
    > STORAGESPACEASSIGNED TEXT(50)
    > )
    >
    >
    > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > VALUES ("John Doe", "Kitchen Cabinet");
    >
    > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > VALUES ("Jane Doe", "Apartment's Attic");
    >
    > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > VALUES ("Sam Hugh", "Bedroom Cabinet");
    >
    > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > VALUES ("Tom Jones", "Dining Room's Closet");
    >
    > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > VALUES ("Erica James", "None");
    >
    > Now I would like to test a asp page using the above data. Here I would like
    > to display all the rows containing the fields "name" and
    > "StorageSpaceAssigned". I would like to display the same table twice but in
    > different format. The first one is a display only table of the above
    > specification while the latter table should show each of the cells as text
    > box (otherwise the display would be same as the first table).
    >
    > The following is the code to generate the two similar tables in a asp page.
    > CODE:
    > <% 'The following is code for connecting to the database
    > myDSN="Provider=Microsoft.Jet.OLEDB.4.0;" & _
    > "Data Source=C:\test.mdb"
    >
    >
    >
    > set CN=server.createobject("ADODB.Connection")
    > set rs=server.createobject("ADODB.Recordset")
    > set rstemp=server.createobject("ADODB.Recordset")
    >
    > CN.Open myDSN
    >
    > rstemp.ActiveConnection = CN
    > rs.ActiveConnection = CN
    > %>
    >
    > <%
    >
    > i = 0
    >
    > sql01 = "SELECT * from tblTest "
    >
    > rstemp.open sql01
    >
    > Response.Write "<TABLE BORDER=1>"
    > Do while not rstemp.EOF
    > Response.Write "<TR><TD>" & rstemp("Name") & "&nbsp;</TD>"
    > Response.Write "<TD>" & rstemp("StorageSpaceAssigned") &
    > "&nbsp;</TD></TR>"
    > rstemp.MoveNext
    > Loop
    > Response.Write "</TABLE>"
    > rstemp.Close
    >
    > 'Response.End
    >
    > rstemp.Open sql01
    >
    >
    >
    >
    > Do until rstemp.eof
    >
    > i = i + 1
    > response.write "<TR>" & vbCRLF
    > strLink = "<TD WIDTH=1% ><INPUT TYPE='HIDDEN' NAME='ID_" & i & "'
    > VALUE=" & rstemp("ID") & "></TD>" & vbCRLF
    > response.write strLink & vbCRLF
    >
    > strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=10
    > NAME='name_" & i & "' VALUE='" & rstemp("Name") & "'></TD>" & vbCRLF
    > response.write strLink & vbCRLF
    >
    > strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=15
    > NAME='storagespacesssigned_" & i & "' VALUE='" &
    > rstemp("StorageSpaceAssigned") & "'></TD>" & vbCRLF
    > response.write strLink & vbCRLF
    >
    >
    > response.write strLink & vbCRLF
    >
    > response.write "</TR>" & vbCRLF
    >
    >
    > rstemp.movenext
    >
    > loop
    > rstemp.close
    > %>
    >
    >
    > However, the display of the second table is not coming in the same table
    > format as the first and rather is screwed up. I would like to get an input as
    > to why this display is getting screwed up. Thanks for any help.



    It's difficult to see why you assign the text to a variable strLink
    before response.writing it - especially as you didn't in the first
    example. You should aim for consistency in your code. I guess partly
    because of this, it looks like you duplicate some output just before
    finishing the last </tr>. You response.write strLink twice (and you
    haven't closed the table either)

    Try this:

    Do until rstemp.eof
    i = i + 1
    response.write "<TR>" & vbCRLF
    response.write "<TD WIDTH=1% ><INPUT TYPE='HIDDEN' NAME='ID_" &
    i & "'
    VALUE=" & rstemp("ID") & "></TD>" & vbCRLF
    response.write "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text'
    SIZE=10
    NAME='name_" & i & "' VALUE='" & rstemp("Name") & "'></TD>" & vbCRLF
    response.write "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text'
    SIZE=15
    NAME='storagespacesssigned_" & i & "' VALUE='" &
    rstemp("StorageSpaceAssigned") & "'></TD>" & vbCRLF
    response.write "</TR>" & vbCRLF
    rstemp.movenext
    loop
    response.write "</TABLE>" & vbcrlf
    rstemp.close

    Also, check the spelling of the name you gave the input for
    StorageSpaceAssigned. There are 3 's' in there.

    /P.
     
    Paxton, Jan 17, 2006
    #2
    1. Advertising

  3. Jack

    Jack Guest

    Thanks Paxton for the help. With your code change the two tables are
    generating fine with only one difference i.e. the contents of the first table
    shows the whole field for the spaceassigned field while the contents of the
    spaceassigned field in the second table shows values which gets truncated
    from the single quote all the aphabets in the right. Any idea why?

    "Paxton" wrote:

    >
    > Jack wrote:
    > > Hi,
    > > I have the following Access DDL statment from which I generated a access
    > > table:
    > > CREATE TABLE TEST1
    > > (ID COUNTER,
    > > NAME TEXT(50),
    > > STORAGESPACEASSIGNED TEXT(50)
    > > )
    > >
    > >
    > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > VALUES ("John Doe", "Kitchen Cabinet");
    > >
    > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > VALUES ("Jane Doe", "Apartment's Attic");
    > >
    > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > VALUES ("Sam Hugh", "Bedroom Cabinet");
    > >
    > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > VALUES ("Tom Jones", "Dining Room's Closet");
    > >
    > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > VALUES ("Erica James", "None");
    > >
    > > Now I would like to test a asp page using the above data. Here I would like
    > > to display all the rows containing the fields "name" and
    > > "StorageSpaceAssigned". I would like to display the same table twice but in
    > > different format. The first one is a display only table of the above
    > > specification while the latter table should show each of the cells as text
    > > box (otherwise the display would be same as the first table).
    > >
    > > The following is the code to generate the two similar tables in a asp page.
    > > CODE:
    > > <% 'The following is code for connecting to the database
    > > myDSN="Provider=Microsoft.Jet.OLEDB.4.0;" & _
    > > "Data Source=C:\test.mdb"
    > >
    > >
    > >
    > > set CN=server.createobject("ADODB.Connection")
    > > set rs=server.createobject("ADODB.Recordset")
    > > set rstemp=server.createobject("ADODB.Recordset")
    > >
    > > CN.Open myDSN
    > >
    > > rstemp.ActiveConnection = CN
    > > rs.ActiveConnection = CN
    > > %>
    > >
    > > <%
    > >
    > > i = 0
    > >
    > > sql01 = "SELECT * from tblTest "
    > >
    > > rstemp.open sql01
    > >
    > > Response.Write "<TABLE BORDER=1>"
    > > Do while not rstemp.EOF
    > > Response.Write "<TR><TD>" & rstemp("Name") & "&nbsp;</TD>"
    > > Response.Write "<TD>" & rstemp("StorageSpaceAssigned") &
    > > "&nbsp;</TD></TR>"
    > > rstemp.MoveNext
    > > Loop
    > > Response.Write "</TABLE>"
    > > rstemp.Close
    > >
    > > 'Response.End
    > >
    > > rstemp.Open sql01
    > >
    > >
    > >
    > >
    > > Do until rstemp.eof
    > >
    > > i = i + 1
    > > response.write "<TR>" & vbCRLF
    > > strLink = "<TD WIDTH=1% ><INPUT TYPE='HIDDEN' NAME='ID_" & i & "'
    > > VALUE=" & rstemp("ID") & "></TD>" & vbCRLF
    > > response.write strLink & vbCRLF
    > >
    > > strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=10
    > > NAME='name_" & i & "' VALUE='" & rstemp("Name") & "'></TD>" & vbCRLF
    > > response.write strLink & vbCRLF
    > >
    > > strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=15
    > > NAME='storagespacesssigned_" & i & "' VALUE='" &
    > > rstemp("StorageSpaceAssigned") & "'></TD>" & vbCRLF
    > > response.write strLink & vbCRLF
    > >
    > >
    > > response.write strLink & vbCRLF
    > >
    > > response.write "</TR>" & vbCRLF
    > >
    > >
    > > rstemp.movenext
    > >
    > > loop
    > > rstemp.close
    > > %>
    > >
    > >
    > > However, the display of the second table is not coming in the same table
    > > format as the first and rather is screwed up. I would like to get an input as
    > > to why this display is getting screwed up. Thanks for any help.

    >
    >
    > It's difficult to see why you assign the text to a variable strLink
    > before response.writing it - especially as you didn't in the first
    > example. You should aim for consistency in your code. I guess partly
    > because of this, it looks like you duplicate some output just before
    > finishing the last </tr>. You response.write strLink twice (and you
    > haven't closed the table either)
    >
    > Try this:
    >
    > Do until rstemp.eof
    > i = i + 1
    > response.write "<TR>" & vbCRLF
    > response.write "<TD WIDTH=1% ><INPUT TYPE='HIDDEN' NAME='ID_" &
    > i & "'
    > VALUE=" & rstemp("ID") & "></TD>" & vbCRLF
    > response.write "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text'
    > SIZE=10
    > NAME='name_" & i & "' VALUE='" & rstemp("Name") & "'></TD>" & vbCRLF
    > response.write "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text'
    > SIZE=15
    > NAME='storagespacesssigned_" & i & "' VALUE='" &
    > rstemp("StorageSpaceAssigned") & "'></TD>" & vbCRLF
    > response.write "</TR>" & vbCRLF
    > rstemp.movenext
    > loop
    > response.write "</TABLE>" & vbcrlf
    > rstemp.close
    >
    > Also, check the spelling of the name you gave the input for
    > StorageSpaceAssigned. There are 3 's' in there.
    >
    > /P.
    >
    >
     
    Jack, Jan 17, 2006
    #3
  4. Jack

    Paxton Guest

    Jack wrote:
    > Thanks Paxton for the help. With your code change the two tables are
    > generating fine with only one difference i.e. the contents of the first table
    > shows the whole field for the spaceassigned field while the contents of the
    > spaceassigned field in the second table shows values which gets truncated
    > from the single quote all the aphabets in the right. Any idea why?
    >
    > "Paxton" wrote:
    >
    > >
    > > Jack wrote:
    > > > Hi,
    > > > I have the following Access DDL statment from which I generated a access
    > > > table:
    > > > CREATE TABLE TEST1
    > > > (ID COUNTER,
    > > > NAME TEXT(50),
    > > > STORAGESPACEASSIGNED TEXT(50)
    > > > )
    > > >
    > > >
    > > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > > VALUES ("John Doe", "Kitchen Cabinet");
    > > >
    > > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > > VALUES ("Jane Doe", "Apartment's Attic");
    > > >
    > > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > > VALUES ("Sam Hugh", "Bedroom Cabinet");
    > > >
    > > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > > VALUES ("Tom Jones", "Dining Room's Closet");
    > > >
    > > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > > VALUES ("Erica James", "None");
    > > >
    > > > Now I would like to test a asp page using the above data. Here I would like
    > > > to display all the rows containing the fields "name" and
    > > > "StorageSpaceAssigned". I would like to display the same table twice but in
    > > > different format. The first one is a display only table of the above
    > > > specification while the latter table should show each of the cells as text
    > > > box (otherwise the display would be same as the first table).
    > > >
    > > > The following is the code to generate the two similar tables in a asp page.
    > > > CODE:
    > > > <% 'The following is code for connecting to the database
    > > > myDSN="Provider=Microsoft.Jet.OLEDB.4.0;" & _
    > > > "Data Source=C:\test.mdb"
    > > >
    > > >
    > > >
    > > > set CN=server.createobject("ADODB.Connection")
    > > > set rs=server.createobject("ADODB.Recordset")
    > > > set rstemp=server.createobject("ADODB.Recordset")
    > > >
    > > > CN.Open myDSN
    > > >
    > > > rstemp.ActiveConnection = CN
    > > > rs.ActiveConnection = CN
    > > > %>
    > > >
    > > > <%
    > > >
    > > > i = 0
    > > >
    > > > sql01 = "SELECT * from tblTest "
    > > >
    > > > rstemp.open sql01
    > > >
    > > > Response.Write "<TABLE BORDER=1>"
    > > > Do while not rstemp.EOF
    > > > Response.Write "<TR><TD>" & rstemp("Name") & "&nbsp;</TD>"
    > > > Response.Write "<TD>" & rstemp("StorageSpaceAssigned") &
    > > > "&nbsp;</TD></TR>"
    > > > rstemp.MoveNext
    > > > Loop
    > > > Response.Write "</TABLE>"
    > > > rstemp.Close
    > > >
    > > > 'Response.End
    > > >
    > > > rstemp.Open sql01
    > > >
    > > >
    > > >
    > > >
    > > > Do until rstemp.eof
    > > >
    > > > i = i + 1
    > > > response.write "<TR>" & vbCRLF
    > > > strLink = "<TD WIDTH=1% ><INPUT TYPE='HIDDEN' NAME='ID_" & i & "'
    > > > VALUE=" & rstemp("ID") & "></TD>" & vbCRLF
    > > > response.write strLink & vbCRLF
    > > >
    > > > strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=10
    > > > NAME='name_" & i & "' VALUE='" & rstemp("Name") & "'></TD>" & vbCRLF
    > > > response.write strLink & vbCRLF
    > > >
    > > > strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=15
    > > > NAME='storagespacesssigned_" & i & "' VALUE='" &
    > > > rstemp("StorageSpaceAssigned") & "'></TD>" & vbCRLF
    > > > response.write strLink & vbCRLF
    > > >
    > > >
    > > > response.write strLink & vbCRLF
    > > >
    > > > response.write "</TR>" & vbCRLF
    > > >
    > > >
    > > > rstemp.movenext
    > > >
    > > > loop
    > > > rstemp.close
    > > > %>
    > > >
    > > >
    > > > However, the display of the second table is not coming in the same table
    > > > format as the first and rather is screwed up. I would like to get an input as
    > > > to why this display is getting screwed up. Thanks for any help.

    > >
    > >
    > > It's difficult to see why you assign the text to a variable strLink
    > > before response.writing it - especially as you didn't in the first
    > > example. You should aim for consistency in your code. I guess partly
    > > because of this, it looks like you duplicate some output just before
    > > finishing the last </tr>. You response.write strLink twice (and you
    > > haven't closed the table either)
    > >
    > > Try this:
    > >
    > > Do until rstemp.eof
    > > i = i + 1
    > > response.write "<TR>" & vbCRLF
    > > response.write "<TD WIDTH=1% ><INPUT TYPE='HIDDEN' NAME='ID_" &
    > > i & "'
    > > VALUE=" & rstemp("ID") & "></TD>" & vbCRLF
    > > response.write "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text'
    > > SIZE=10
    > > NAME='name_" & i & "' VALUE='" & rstemp("Name") & "'></TD>" & vbCRLF
    > > response.write "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text'
    > > SIZE=15
    > > NAME='storagespacesssigned_" & i & "' VALUE='" &
    > > rstemp("StorageSpaceAssigned") & "'></TD>" & vbCRLF
    > > response.write "</TR>" & vbCRLF
    > > rstemp.movenext
    > > loop
    > > response.write "</TABLE>" & vbcrlf
    > > rstemp.close
    > >
    > > Also, check the spelling of the name you gave the input for
    > > StorageSpaceAssigned. There are 3 's' in there.
    > >
    > > /P.
    > >
    > >


    You have a short memory. It was only a few days ago that you had
    exactly the same problem:

    http://groups.google.com/group/micr...2313ef7ed02/0ffe9609ad72e7a2#0ffe9609ad72e7a2

    /P.
     
    Paxton, Jan 17, 2006
    #4
  5. Jack

    Jack Guest

    Thanks Paxton for pointing that out. Actually with your and Bob Burrows
    advise, I tried
    two different ways to incorporate that in the code I had. I did not have any
    success. I guess the code needs to be cleaned further. Here, with the
    current clean
    code it did work with the triple double quote concept incorporation. Thanks
    a lot for all the help.
    I appreciate it. Best regards.

    "Paxton" wrote:

    >
    > Jack wrote:
    > > Thanks Paxton for the help. With your code change the two tables are
    > > generating fine with only one difference i.e. the contents of the first table
    > > shows the whole field for the spaceassigned field while the contents of the
    > > spaceassigned field in the second table shows values which gets truncated
    > > from the single quote all the aphabets in the right. Any idea why?
    > >
    > > "Paxton" wrote:
    > >
    > > >
    > > > Jack wrote:
    > > > > Hi,
    > > > > I have the following Access DDL statment from which I generated a access
    > > > > table:
    > > > > CREATE TABLE TEST1
    > > > > (ID COUNTER,
    > > > > NAME TEXT(50),
    > > > > STORAGESPACEASSIGNED TEXT(50)
    > > > > )
    > > > >
    > > > >
    > > > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > > > VALUES ("John Doe", "Kitchen Cabinet");
    > > > >
    > > > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > > > VALUES ("Jane Doe", "Apartment's Attic");
    > > > >
    > > > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > > > VALUES ("Sam Hugh", "Bedroom Cabinet");
    > > > >
    > > > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > > > VALUES ("Tom Jones", "Dining Room's Closet");
    > > > >
    > > > > INSERT INTO test1 ( Name, StorageSpaceAssigned )
    > > > > VALUES ("Erica James", "None");
    > > > >
    > > > > Now I would like to test a asp page using the above data. Here I would like
    > > > > to display all the rows containing the fields "name" and
    > > > > "StorageSpaceAssigned". I would like to display the same table twice but in
    > > > > different format. The first one is a display only table of the above
    > > > > specification while the latter table should show each of the cells as text
    > > > > box (otherwise the display would be same as the first table).
    > > > >
    > > > > The following is the code to generate the two similar tables in a asp page.
    > > > > CODE:
    > > > > <% 'The following is code for connecting to the database
    > > > > myDSN="Provider=Microsoft.Jet.OLEDB.4.0;" & _
    > > > > "Data Source=C:\test.mdb"
    > > > >
    > > > >
    > > > >
    > > > > set CN=server.createobject("ADODB.Connection")
    > > > > set rs=server.createobject("ADODB.Recordset")
    > > > > set rstemp=server.createobject("ADODB.Recordset")
    > > > >
    > > > > CN.Open myDSN
    > > > >
    > > > > rstemp.ActiveConnection = CN
    > > > > rs.ActiveConnection = CN
    > > > > %>
    > > > >
    > > > > <%
    > > > >
    > > > > i = 0
    > > > >
    > > > > sql01 = "SELECT * from tblTest "
    > > > >
    > > > > rstemp.open sql01
    > > > >
    > > > > Response.Write "<TABLE BORDER=1>"
    > > > > Do while not rstemp.EOF
    > > > > Response.Write "<TR><TD>" & rstemp("Name") & "&nbsp;</TD>"
    > > > > Response.Write "<TD>" & rstemp("StorageSpaceAssigned") &
    > > > > "&nbsp;</TD></TR>"
    > > > > rstemp.MoveNext
    > > > > Loop
    > > > > Response.Write "</TABLE>"
    > > > > rstemp.Close
    > > > >
    > > > > 'Response.End
    > > > >
    > > > > rstemp.Open sql01
    > > > >
    > > > >
    > > > >
    > > > >
    > > > > Do until rstemp.eof
    > > > >
    > > > > i = i + 1
    > > > > response.write "<TR>" & vbCRLF
    > > > > strLink = "<TD WIDTH=1% ><INPUT TYPE='HIDDEN' NAME='ID_" & i & "'
    > > > > VALUE=" & rstemp("ID") & "></TD>" & vbCRLF
    > > > > response.write strLink & vbCRLF
    > > > >
    > > > > strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=10
    > > > > NAME='name_" & i & "' VALUE='" & rstemp("Name") & "'></TD>" & vbCRLF
    > > > > response.write strLink & vbCRLF
    > > > >
    > > > > strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=15
    > > > > NAME='storagespacesssigned_" & i & "' VALUE='" &
    > > > > rstemp("StorageSpaceAssigned") & "'></TD>" & vbCRLF
    > > > > response.write strLink & vbCRLF
    > > > >
    > > > >
    > > > > response.write strLink & vbCRLF
    > > > >
    > > > > response.write "</TR>" & vbCRLF
    > > > >
    > > > >
    > > > > rstemp.movenext
    > > > >
    > > > > loop
    > > > > rstemp.close
    > > > > %>
    > > > >
    > > > >
    > > > > However, the display of the second table is not coming in the same table
    > > > > format as the first and rather is screwed up. I would like to get an input as
    > > > > to why this display is getting screwed up. Thanks for any help.
    > > >
    > > >
    > > > It's difficult to see why you assign the text to a variable strLink
    > > > before response.writing it - especially as you didn't in the first
    > > > example. You should aim for consistency in your code. I guess partly
    > > > because of this, it looks like you duplicate some output just before
    > > > finishing the last </tr>. You response.write strLink twice (and you
    > > > haven't closed the table either)
    > > >
    > > > Try this:
    > > >
    > > > Do until rstemp.eof
    > > > i = i + 1
    > > > response.write "<TR>" & vbCRLF
    > > > response.write "<TD WIDTH=1% ><INPUT TYPE='HIDDEN' NAME='ID_" &
    > > > i & "'
    > > > VALUE=" & rstemp("ID") & "></TD>" & vbCRLF
    > > > response.write "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text'
    > > > SIZE=10
    > > > NAME='name_" & i & "' VALUE='" & rstemp("Name") & "'></TD>" & vbCRLF
    > > > response.write "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text'
    > > > SIZE=15
    > > > NAME='storagespacesssigned_" & i & "' VALUE='" &
    > > > rstemp("StorageSpaceAssigned") & "'></TD>" & vbCRLF
    > > > response.write "</TR>" & vbCRLF
    > > > rstemp.movenext
    > > > loop
    > > > response.write "</TABLE>" & vbcrlf
    > > > rstemp.close
    > > >
    > > > Also, check the spelling of the name you gave the input for
    > > > StorageSpaceAssigned. There are 3 's' in there.
    > > >
    > > > /P.
    > > >
    > > >

    >
    > You have a short memory. It was only a few days ago that you had
    > exactly the same problem:
    >
    > http://groups.google.com/group/micr...2313ef7ed02/0ffe9609ad72e7a2#0ffe9609ad72e7a2
    >
    > /P.
    >
    >
     
    Jack, Jan 17, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    806
    mlimber
    Sep 11, 2006
  2. Sameer
    Replies:
    1
    Views:
    776
  3. islamelnaggar
    Replies:
    4
    Views:
    2,990
    islamelnaggar
    Feb 24, 2008
  4. islamelnaggar
    Replies:
    0
    Views:
    489
    islamelnaggar
    Feb 24, 2008
  5. Lee Falataco
    Replies:
    2
    Views:
    354
    Bullschmidt
    Aug 10, 2004
Loading...

Share This Page