J
John Baker
Hi:
This is the only ASP newsgroup I can access using Verizon, and I would like to know a real
basic piece of information. I am totall new to ASP, although I have done HTML coding.
Say I The following code is intended to ask for an individuals HIRE Number and then pass
it on to a query, which returns time data for the week. It doesn't work, and I can only
assume that the way I have set it up, or the way I am attempting to set or refer to the
variable HIREID, is wrong. It would be an immeasurable help if someone could point out my
error and how I can fix it! It would alsoi be helpful to know how I grab the data that
comes from the query so I can display it.
John Baker
CODE:
<%@ Page Language="VB" %>
<%@ Register TagPrefix="wmx" Namespace="Microsoft.Matrix.Framework.Web.UI"
Assembly="Microsoft.Matrix.Framework, Version=0.6.0.0, Culture=neutral,
PublicKeyToken=6f763c9966660626" %>
<script runat="server">
Function MyQueryMethod(ByVal hireNumber As String) As System.Data.DataSet
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4;
Data Source=C:\IPT\Test\Tim"& _
"eData.mdb"
Dim dbConnection As System.Data.IDbConnection = New
System.Data.OleDb.OleDbConnection(connectionString)
Dim queryString As String = "SELECT
[TimeData].[Thu],
[TimeData].[Sun],
[TimeData].[Fri],
[TimeData].[Wed],
[TimeData].[Sat],
[TimeData].[WeekStart],
[TimeData].[AssocName],
[TimeData].[Task_Key],
[TimeData].[PO],
[TimeData].[Mon],
[TimeData].[Tue],
[TimeData].[HireNumber] FROM [TimeData]
WHERE ([TimeData].[HireNumber] = HIREID)"
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_hireNumber As System.Data.IDataParameter = New
System.Data.OleDb.OleDbParameter
dbParam_hireNumber.ParameterName = "HIREID"
dbParam_hireNumber.Value = hireNumber
dbParam_hireNumber.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_hireNumber)
Dim dataAdapter As System.Data.IDbDataAdapter = New
System.Data.OleDb.OleDbDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function
</script>
<html>
<head>
</head>
<body>
<!-- Insert content here -->
<p align="center">
<img style="WIDTH: 417px; HEIGHT: 179px" height="216" src="IPT logo clear.jpg"
width="472" />
</p>
<p align="center">
<strong style="FONT-SIZE: x-large"><font color="red">IPT Asociates Timesheet
Recording
Process</font></strong>
</p>
<p align="center">
<strong><font color="#ff0000" size="6"></font></strong>
</p>
<p align="center">
</p>
<center>
<form action="intro1.aspx" method="post">
<h3>Hire Number :
<input id="HIREID" type="text" />
<h3>Password :
<input id="Password" type="text" />
</h3>
</h3>
</form>
</center>
</body>
</html>
This is the only ASP newsgroup I can access using Verizon, and I would like to know a real
basic piece of information. I am totall new to ASP, although I have done HTML coding.
Say I The following code is intended to ask for an individuals HIRE Number and then pass
it on to a query, which returns time data for the week. It doesn't work, and I can only
assume that the way I have set it up, or the way I am attempting to set or refer to the
variable HIREID, is wrong. It would be an immeasurable help if someone could point out my
error and how I can fix it! It would alsoi be helpful to know how I grab the data that
comes from the query so I can display it.
John Baker
CODE:
<%@ Page Language="VB" %>
<%@ Register TagPrefix="wmx" Namespace="Microsoft.Matrix.Framework.Web.UI"
Assembly="Microsoft.Matrix.Framework, Version=0.6.0.0, Culture=neutral,
PublicKeyToken=6f763c9966660626" %>
<script runat="server">
Function MyQueryMethod(ByVal hireNumber As String) As System.Data.DataSet
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4;
Data Source=C:\IPT\Test\Tim"& _
"eData.mdb"
Dim dbConnection As System.Data.IDbConnection = New
System.Data.OleDb.OleDbConnection(connectionString)
Dim queryString As String = "SELECT
[TimeData].[Thu],
[TimeData].[Sun],
[TimeData].[Fri],
[TimeData].[Wed],
[TimeData].[Sat],
[TimeData].[WeekStart],
[TimeData].[AssocName],
[TimeData].[Task_Key],
[TimeData].[PO],
[TimeData].[Mon],
[TimeData].[Tue],
[TimeData].[HireNumber] FROM [TimeData]
WHERE ([TimeData].[HireNumber] = HIREID)"
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_hireNumber As System.Data.IDataParameter = New
System.Data.OleDb.OleDbParameter
dbParam_hireNumber.ParameterName = "HIREID"
dbParam_hireNumber.Value = hireNumber
dbParam_hireNumber.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_hireNumber)
Dim dataAdapter As System.Data.IDbDataAdapter = New
System.Data.OleDb.OleDbDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function
</script>
<html>
<head>
</head>
<body>
<!-- Insert content here -->
<p align="center">
<img style="WIDTH: 417px; HEIGHT: 179px" height="216" src="IPT logo clear.jpg"
width="472" />
</p>
<p align="center">
<strong style="FONT-SIZE: x-large"><font color="red">IPT Asociates Timesheet
Recording
Process</font></strong>
</p>
<p align="center">
<strong><font color="#ff0000" size="6"></font></strong>
</p>
<p align="center">
</p>
<center>
<form action="intro1.aspx" method="post">
<h3>Hire Number :
<input id="HIREID" type="text" />
<h3>Password :
<input id="Password" type="text" />
</h3>
</h3>
</form>
</center>
</body>
</html>