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)
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>
|
|
|
|
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)
Sam Keep it Simple Make it Fun KiSMiF
|
|
|
|
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)
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.
|
|
|
|
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)
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
|
|
|
|
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)
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.
|
|
|
|
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)
Sam Keep it Simple Make it Fun KiSMiF
|
|
|
|