Database on SQL server

Author Message
SanChez

  • Total Posts : 3
  • Scores: 0
  • Reward points : 0
  • Joined: 7/9/2007
  • Status: offline
Database on SQL server Monday, July 09, 2007 6:01 AM (permalink)
0
I really need some help. I'm making a database, which I've never done before, but I'm expected to figure it out. I have a db on a sql server and a vbs file with this script.

 <html>
 <head>
 <script type="text/vbscript">
 <%
 Session.timeout = 15
 Set conn = Server.CreateObject("ADODB.Connection")
 conn.open "BLBTDBDBA01","db2db","db2db"
 Set Session("MyDB_conn") = conn
 strSQLQuery = "SELECT * FROM DDB2T000 "
 Set rs = Server.CreateObject("ADODB.Recordset")
 rs.Open strSQLQuery, conn, 3, 3
 conn.close
 set conn = Nothing
 %>
 </script>
 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
 <title>Applied</title>
 </head>
 <body>
 <table width="100%" border="1">
 <thead>
    <tr>
          <th align="left"><b>Applied</b></th>
          <th align="left"><b>ETR</b></th>
          <th align="left"><b>APAR</b></th>
          <th align="left"><b>PTF</b></th>
          <th align="left"><b>APAR_fix</b></th>
          <th align="left"><b>Date_Avaliable</b></th>
          <th align="left"><b>DB2_Version</b></th>
          <th align="left"><b>Mode</b></th>
          <th align="left"><b>Comments</b></th>
          <th align="left"><b>PEd</b></th>
          <th align="left"><b>Package</b></th>
          <th align="left"><b>Reported_By</b></th>
          <th align="left"><b>Date_Added</b></th>
   </tr>
 </thead>
 <tbody>
 <tr>
 <td></td>  
 <td></td>  
 <td></td>  
 <td></td>  
 <td></td>  
 <td></td>  
 <td></td>  
 <td></td>  
 <td></td>  
 <td></td>  
 <td></td>  
 <td></td>  
 <td></td>  
 </tr>
 </tbody>
 </body>
 </html>
 


Am I on the right track? Do I just insert this file into my other pages and a db magically appears? I assume this would make a table show up with my information in it. I'm completly lost.
 
 
Edit:
I guess I should take the VBScript out of that code... and my question now is How do I transfer data from a SQL Server to an asp form using VBScript?
<message edited by SanChez on Monday, July 09, 2007 7:08 AM>
 
#1
    mcds99

    • Total Posts : 519
    • Scores: 4
    • Reward points : 0
    • Joined: 2/28/2006
    • Status: offline
    RE: Database on SQL server Monday, July 09, 2007 8:59 AM (permalink)
    0
    Is this home work?
    Sam

    Keep it Simple Make it Fun KiSMiF
     
    #2
      SanChez

      • Total Posts : 3
      • Scores: 0
      • Reward points : 0
      • Joined: 7/9/2007
      • Status: offline
      RE: Database on SQL server Tuesday, July 10, 2007 12:36 AM (permalink)
      0
      No, I'm not that lucky. =]  I'm helping another intern at my job. Neiter of us really knows how to do this but he had too much work to handle so I took on this project.
       
      #3
        mcds99

        • Total Posts : 519
        • Scores: 4
        • Reward points : 0
        • Joined: 2/28/2006
        • Status: offline
        RE: Database on SQL server Thursday, July 12, 2007 3:57 AM (permalink)
        0
        Someone moved this to a different spot...

        I put the code in an html file and it generated the headers.

        You need to get the values from the database.

        If I assume, something I don't like to do (we all know why), that the table column headers are the names of the columns in the SQL table then you still need to pull the data from the database and put it in to the html table.

        Put each value in to a variable something like this

        valueA = applied.value
        valueB = etr.value

        Then put the variables in to the html table.

        Use something like <td><input type="text" name="valueA"></td>



        Sam

        Keep it Simple Make it Fun KiSMiF
         
        #4
          SanChez

          • Total Posts : 3
          • Scores: 0
          • Reward points : 0
          • Joined: 7/9/2007
          • Status: offline
          RE: Database on SQL server Thursday, July 12, 2007 4:37 AM (permalink)
          0
          thank you, thank you, thank you. i've posted this question on so many different sites and your answer was the most helpful of all.
           
          #5
            mcds99

            • Total Posts : 519
            • Scores: 4
            • Reward points : 0
            • Joined: 2/28/2006
            • Status: offline
            RE: Database on SQL server Wednesday, July 18, 2007 8:24 AM (permalink)
            0
            I can be of some use ;-)
            Sam

            Keep it Simple Make it Fun KiSMiF
             
            #6

              Online Bookmarks Sharing: Share/Bookmark

              Jump to:

              Current active users

              There are 0 members and 1 guests.

              Icon Legend and Permission

              • New Messages
              • No New Messages
              • Hot Topic w/ New Messages
              • Hot Topic w/o New Messages
              • Locked w/ New Messages
              • Locked w/o New Messages
              • Read Message
              • Post New Thread
              • Reply to message
              • Post New Poll
              • Submit Vote
              • Post reward post
              • Delete my own posts
              • Delete my own threads
              • Rate post

              2000-2012 ASPPlayground.NET Forum Version 3.9