Kathleen422
Technical User
Hi all, I keep getting a error on this on the
objCommand.CommandType = adCmdText
Can't figure out for the life of me what I am doing wrong. Please help
<! -- #include file="adovbs.inc" -->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Temporary Labor Inquiry</title>
</head>
<font color="#CE0000" face="Century Gothic" size="4"><b>TEMPORARY LABOR </b></font><br>
<a href="../../Default.asp">Home</a><br> <br>
<div align="left">
<table border="1" width="1500" height="40">
<tr>
<td width="1200" align = "center" colspan="11">
<p align="left"><b><font color="#CE0000" face="Century Gothic">
CONFIDENTIAL INFORMATION</font></b></td>
</tr>
<tr>
<td width="100" align = "center">Invoice No.</td>
<td width="100" align = "center">Invoice Date</td>
<td width="100" align = "center">Wk. Ending</td>
<td width="100" align = "center">Cost Center</td>
<td width="150" align = "left">Name</td>
<td width="100" align = "right">Rate</td>
<td width="150" align = "left">Description</td>
<td width="100" align = "right">Regular Hours</td>
<td width="100" align = "right">Time & a Half</td>
<td width="100" align = "right">Double Time </td>
<td width="100" align ="right">Amount</td>
</tr>
<%
Dim objCommand, objRs, strConnect
Set objCommand = Server.CreateObject("ADODB.Command")
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & server.mappath("../../fpdb/VWF.mdb") & ";" & _
"User Id=admin;" & "Password=;"
objCommand.ActiveConnection = strConnect
objCommand.CommandText = "SELECT * FROM tblInvoicing " & _
"INNER JOIN tblCostCenters ON tblInvoicing.Cost_Center = tblCostCenters.CostCtr " & _
"WHERE Invoice_Number =('" & request.form("InvoiceNumber") & "') AND ((tblCostCenters.Div)='AF')"
objCommand.CommandType = adCmdText
Set objRs = objCommand.Execute
set objCommand = Nothing
while not objRs.eof
Response.write "<tr><td align = center>" & objRs("Invoice_Number") & "</td>"
Response.write "<td align=center>" & objRs("Invoice_Date") & "</td>"
Response.write "<td align=center>" & objRs("Time_Card_Wk_Ending") & "</td>"
Response.write "<td align=center>" & objRs("Cost_Center") & "</td>"
Response.write "<td align=left>" & objRs("Name") & "</td>"
Response.write "<td align=right>" & (formatcurrency(objRs("Regular_Rate"))) & "</td>"
Response.write "<td align=left>" & objRs("Pay_Bill_Description")& "</td>"
Response.write "<td align=right>" & objRs("Regular_Hours") & " hrs = " & (formatcurrency(objRs("Regular_Bill_Amt"))) & "</td>"
Response.write "<td align=right>" & objRs("Premium_Hours") & " hrs = " & (formatcurrency(objRs("Premium_Bil_Amount"))) & "</td>"
Response.write "<td align=right>" & objRs("Doubletime_Hours") & "hrs = " & (formatcurrency(objRs("DoubleTime_Bil_Amt"))) &"</td>"
Response.write "<td align=right>" & (formatcurrency(objRs("Total_Billed_Amount"))) & "</td></tr>"
objRs.movenext
Wend
objRs.Close
Set objRs=nothing
%>
</table>
</div>
</body>
</html>
objCommand.CommandType = adCmdText
Can't figure out for the life of me what I am doing wrong. Please help
<! -- #include file="adovbs.inc" -->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Temporary Labor Inquiry</title>
</head>
<font color="#CE0000" face="Century Gothic" size="4"><b>TEMPORARY LABOR </b></font><br>
<a href="../../Default.asp">Home</a><br> <br>
<div align="left">
<table border="1" width="1500" height="40">
<tr>
<td width="1200" align = "center" colspan="11">
<p align="left"><b><font color="#CE0000" face="Century Gothic">
CONFIDENTIAL INFORMATION</font></b></td>
</tr>
<tr>
<td width="100" align = "center">Invoice No.</td>
<td width="100" align = "center">Invoice Date</td>
<td width="100" align = "center">Wk. Ending</td>
<td width="100" align = "center">Cost Center</td>
<td width="150" align = "left">Name</td>
<td width="100" align = "right">Rate</td>
<td width="150" align = "left">Description</td>
<td width="100" align = "right">Regular Hours</td>
<td width="100" align = "right">Time & a Half</td>
<td width="100" align = "right">Double Time </td>
<td width="100" align ="right">Amount</td>
</tr>
<%
Dim objCommand, objRs, strConnect
Set objCommand = Server.CreateObject("ADODB.Command")
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & server.mappath("../../fpdb/VWF.mdb") & ";" & _
"User Id=admin;" & "Password=;"
objCommand.ActiveConnection = strConnect
objCommand.CommandText = "SELECT * FROM tblInvoicing " & _
"INNER JOIN tblCostCenters ON tblInvoicing.Cost_Center = tblCostCenters.CostCtr " & _
"WHERE Invoice_Number =('" & request.form("InvoiceNumber") & "') AND ((tblCostCenters.Div)='AF')"
objCommand.CommandType = adCmdText
Set objRs = objCommand.Execute
set objCommand = Nothing
while not objRs.eof
Response.write "<tr><td align = center>" & objRs("Invoice_Number") & "</td>"
Response.write "<td align=center>" & objRs("Invoice_Date") & "</td>"
Response.write "<td align=center>" & objRs("Time_Card_Wk_Ending") & "</td>"
Response.write "<td align=center>" & objRs("Cost_Center") & "</td>"
Response.write "<td align=left>" & objRs("Name") & "</td>"
Response.write "<td align=right>" & (formatcurrency(objRs("Regular_Rate"))) & "</td>"
Response.write "<td align=left>" & objRs("Pay_Bill_Description")& "</td>"
Response.write "<td align=right>" & objRs("Regular_Hours") & " hrs = " & (formatcurrency(objRs("Regular_Bill_Amt"))) & "</td>"
Response.write "<td align=right>" & objRs("Premium_Hours") & " hrs = " & (formatcurrency(objRs("Premium_Bil_Amount"))) & "</td>"
Response.write "<td align=right>" & objRs("Doubletime_Hours") & "hrs = " & (formatcurrency(objRs("DoubleTime_Bil_Amt"))) &"</td>"
Response.write "<td align=right>" & (formatcurrency(objRs("Total_Billed_Amount"))) & "</td></tr>"
objRs.movenext
Wend
objRs.Close
Set objRs=nothing
%>
</table>
</div>
</body>
</html>