Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ASP Tables

ASP Tables

Scheduled Pinned Locked Moved ASP.NET
htmldatabasehelp
13 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Jmc_uk

    <%@ Language="VBScript" %> <% Option Explicit %> Low Wing A - Pattern List <% 'declare your variables Dim Connection, Recordset Dim sSQL, sConnString 'declare SQL statement that will query the database ******* NAME OF TABLE ******* sSQL="SELECT * FROM lwa" 'define the connection string, specify database 'driver and the location of database sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & Server.MapPath("../databases/lwa.mdb") ' ****** LOCATION OF DATABASE ******* 'create an ADO connection and recordset Set connection = Server.CreateObject("ADODB.Connection") Set recordset = Server.CreateObject("ADODB.Recordset") 'Open the connection to the database connection.Open sConnString 'Open the recordset object, execute the SQL statement recordset.Open sSQL,connection 'first of all determine whether there are any records If Recordset.EOF Then Response.Write("No records returned.") Else 'If there are records then loop through the fields Do While Not recordset.EOF Response.Write recordset("PICTURE LINK") & " " & recordset("AIRCRAFT TYPE") & " " & _ recordset("AIRCRAFT MODEL") & " " & recordset("COCKPIT") '******** SPECIFIED FIELDS ******* Response.Write "
    " 'insert a line break 'move on to the next record Recordset.MoveNext Loop End If 'close the connection and recordset objects and free up resources Recordset.Close Connection.Close Set Recordset = Nothing Set Connection = Nothing %>

    G Offline
    G Offline
    Gavin Jeffrey
    wrote on last edited by
    #4

    before your do while write out you table headings something like this - response.write "" then in your do while you can write out each data field in a td like so - response.write "" once you are out of your do while loop you can just close the table tag like so - response.write "

    Heading one

    " & recordset("PICTURE LINK") & "

    " just play around until you get your desired look. You can also view the source e.g. right click and select view source in ie6 to check what exactly you are writting out.

    J 1 Reply Last reply
    0
    • G Gavin Jeffrey

      before your do while write out you table headings something like this - response.write "" then in your do while you can write out each data field in a td like so - response.write "" once you are out of your do while loop you can just close the table tag like so - response.write "

      Heading one

      " & recordset("PICTURE LINK") & "

      " just play around until you get your desired look. You can also view the source e.g. right click and select view source in ie6 to check what exactly you are writting out.

      J Offline
      J Offline
      Jmc_uk
      wrote on last edited by
      #5

      Thanx! i will give that ago i thought it was something down the lines of that, but i dont wanna be messing about and getting lost, arg programming! i hate programming! im a hardware man! Thanx, will let you know how it goes...:laugh:

      J 1 Reply Last reply
      0
      • J Jmc_uk

        Thanx! i will give that ago i thought it was something down the lines of that, but i dont wanna be messing about and getting lost, arg programming! i hate programming! im a hardware man! Thanx, will let you know how it goes...:laugh:

        J Offline
        J Offline
        Jmc_uk
        wrote on last edited by
        #6

        *cry* Im lost! http://www.driffieldbroadband.co.uk/lwa.asp[^] I got some tables though... any help appricated!

        X 1 Reply Last reply
        0
        • J Jmc_uk

          *cry* Im lost! http://www.driffieldbroadband.co.uk/lwa.asp[^] I got some tables though... any help appricated!

          X Offline
          X Offline
          XGaMeS
          wrote on last edited by
          #7

          add " to the end of the string :) I am a newbie

          J 1 Reply Last reply
          0
          • X XGaMeS

            add " to the end of the string :) I am a newbie

            J Offline
            J Offline
            Jmc_uk
            wrote on last edited by
            #8

            http://www.driffieldbroadband.co.uk/lwa.asp[^] i decided to re-write it all, found a few probs, now fixed :D but how do i implement styles to say the headings cell but not the actual data cells, say i want the heading cells with a blue background but the data cells a white/no background? thanx for all the feedback..

            S 1 Reply Last reply
            0
            • J Jmc_uk

              http://www.driffieldbroadband.co.uk/lwa.asp[^] i decided to re-write it all, found a few probs, now fixed :D but how do i implement styles to say the headings cell but not the actual data cells, say i want the heading cells with a blue background but the data cells a white/no background? thanx for all the feedback..

              S Offline
              S Offline
              Sebastien Lachance
              wrote on last edited by
              #9

              humm use th tag instead of td for the header and apply color attribute or Stylesheet Well.. later

              J 1 Reply Last reply
              0
              • S Sebastien Lachance

                humm use th tag instead of td for the header and apply color attribute or Stylesheet Well.. later

                J Offline
                J Offline
                Jmc_uk
                wrote on last edited by
                #10

                Could you give me an example to work with, not familiar with tables either, but i am learning!and its working, just need to colour it now Thanx again

                1 Reply Last reply
                0
                • J Jmc_uk

                  Hi I am totally new to ASP and need some help. My scenario is this... I have a database that i want to show in a html style table, i have it so far that it shows the data but not in any table style. Also how do you show the field titles. here is what i have so far... http://www.driffieldbroadband.co.uk/lwa.asp[^] Any help would be fantastic, thanx!

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #11

                  If there's any chance of you moving to ASP.NET, you should. asp is a nightmare. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                  J 1 Reply Last reply
                  0
                  • C Christian Graus

                    If there's any chance of you moving to ASP.NET, you should. asp is a nightmare. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                    J Offline
                    J Offline
                    Jmc_uk
                    wrote on last edited by
                    #12

                    err I thought ASP was ASP.NET *cry hmmm whats it involve and the advantages are? Im sure this should be really really simple! I have done the table, i just need to do a bit of styling, like the font size, colour and heading cell background colour. again any help much appriciated

                    C 1 Reply Last reply
                    0
                    • J Jmc_uk

                      err I thought ASP was ASP.NET *cry hmmm whats it involve and the advantages are? Im sure this should be really really simple! I have done the table, i just need to do a bit of styling, like the font size, colour and heading cell background colour. again any help much appriciated

                      C Offline
                      C Offline
                      Christian Graus
                      wrote on last edited by
                      #13

                      Jmc_uk wrote: err I thought ASP was ASP.NET *cry Nope. Unless you're writing your website using C# or VB.NET, if you're just writing .asp pages and doing business logic in C++ using COM, or similar, then you're using ASP, not ASP.NET. The benefit of ASP.NET is mostly that you're able to use OO and generate websites in a way that the code is sane and easy to read. You'll also be able to easily make your pages a lot richer. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups