View Single Post
  #16 (permalink)  
Old May 23rd, 2011, 04:09 AM
soonkok soonkok is offline
Registered User
 
Join Date: May 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft VBScript runtime error '800a000d'

Hi Dear All,

I need help. I has the following errors:

Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "600 interim"]' [PHPNET][CODE]

/intranet/member/TimeSheet-All/view_timesheet_client_P&L_summary2.asp, line 113

my source code as below:
Code:
<html>
<head>
<title>Paul Wan & Company - Member</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../../include/paulwan.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftMargin="0" topMargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="standardword">
  <tr>
    <td bgcolor="#12085e" width="8%"><b><font color="#FFFFFF">&nbsp;Job No</font></b></td>
	<td bgcolor="#12085e" width="35%"><b><font color="#FFFFFF">Client Name</font></b></td>
	<td bgcolor="#12085e" width="12%"><b><font color="#FFFFFF">Period</font></b></td>
	<td bgcolor="#12085e" width="15%"><b><font color="#FFFFFF">Manager In-Charge</font></b></td>
	<td bgcolor="#12085e" width="10%"><b><font color="#FFFFFF">Audit Fees</font></b></td>
	<td bgcolor="#12085e" width="10%"><b><font color="#FFFFFF">Time Cost</font></b></td>
	<td bgcolor="#12085e" width="10%"><b><font color="#FFFFFF">P/L</font></b></td>
  </tr>
<%	
  	StaffName = Request.Cookies("StaffNames")
	StaffID = Request.Cookies("StaffIDs")
										
	Dim pwcoConnection
    Dim strSQL1, strSQL2, strSQL3
	Dim pwcoRecordset
	JobNo = Request("JobID")
	
	Set pwcoConnection = Server.CreateObject("ADODB.Connection")
    pwcoConnection.ConnectionString = "Provider=Microsoft.jet.oledb.4.0; Data Source=F:\Intranet\database\TimeSheet-Audit.mdb;"
    pwcoConnection.Open
	
	Set pwcoConnection1 = Server.CreateObject("ADODB.Connection")
    pwcoConnection1.ConnectionString = "Provider=Microsoft.jet.oledb.4.0; Data Source=F:\Intranet\database\AuditJob.mdb;"
    pwcoConnection1.Open
	


	strSQL1 = "SELECT company_name, job_No FROM JobPlan WHERE job_No LIKE '9%' GROUP BY company_name, job_No"
	Set pwcoRecordset1 = pwcoConnection1.Execute(strSQL1)
	
	While Not pwcoRecordset1.EOF
	JobNo = pwcoRecordset1("job_No")
		strSQL2 = "SELECT company_ID, company_name, job_period, job_No FROM JobPlan WHERE (action_code = '0' OR action_code = '1') AND job_No = '"+JobNo+"'"
		Set pwcoRecordset2 = pwcoConnection1.Execute(strSQL2)
							
		IF Not pwcoRecordset2.EOF THEN
			ClientID = pwcoRecordset2("company_ID")
			ClientName = pwcoRecordset2("company_name")
			JobPeriod5 = pwcoRecordset2("job_period")			
			
			strSQL3 = "SELECT * FROM jobschedule WHERE job_No = '"+ JobNo +"'"
			Set pwcoRecordset3 = pwcoConnection.Execute(strSQL3)
			
			strSQL4 = "SELECT * FROM JobFees WHERE job_No = '"+ JobNo +"'"
			Set pwcoRecordset4 = pwcoConnection1.Execute(strSQL4)
			
			strSQL7 = "SELECT * FROM JobInCharge WHERE company_ID = '"+ ClientID +"'"
			Set pwcoRecordset7 = pwcoConnection1.Execute(strSQL7)
			IF pwcoRecordset7.EOF THEN
				ManagerName = "N.A"
			ELSE
				ManagerName = pwcoRecordset7("manager_name")
			END IF
			
			Dim AuditFees, TaxFees, AcctFees, SecFees, SpecialFees
			IF pwcoRecordset4.EOF THEN
	    		AuditFees = 0
			ELSE
				AuditFees = pwcoRecordset4("audit_fees")								
			END IF			
			
			Dim OverallHourCharges
			TotalJobHourschr = 0
			TotalJobHoursNonchr = 0
			TotalHourCharges = 0
			OverallHourCharge = 0
			
			WHILE NOT pwcoRecordset3.EOF
				TimeSheetNo = pwcoRecordset3("timesheet_No")
				JobHoursChr = pwcoRecordset3("job_hours_chr")
				JobHoursNonchr = pwcoRecordset3("job_hours_nonchr")
				IF JobHoursChr = "" THEN
					JobHoursChr = 0
				END IF
				IF JobHoursNonchr = "" THEN
					JobHoursNonchr = 0
				END IF				
				TotalJobHourschr = TotalJobHourschr + JobHoursChr
				TotalJobHoursNonchr = TotalJobHoursNonchr + JobHoursNonchr								
					
				strSQL5 = "SELECT * FROM timetable WHERE timesheet_No = '"+TimeSheetNo+"'"
				Set pwcoRecordset5 = pwcoConnection.Execute(strSQL5)
				T_StaffName = pwcoRecordset5("staff_name")
				Department = pwcoRecordset5("department")
				T_Position = pwcoRecordset5("t_position")
					
				strSQL6 = "SELECT * FROM timecost WHERE t_position  = '"+T_Position+"'"
				Set pwcoRecordset6 = pwcoConnection.Execute(strSQL6)
				IF NOT pwcoRecordset6.EOF THEN
					HourCharges = pwcoRecordset6("hour_charges")
				ELSE
					HourCharges = 0
				END IF
				TotalHourCharges = JobHoursChr * HourCharges
				OverallHourCharge = OverallHourCharge + TotalHourCharges
				pwcoRecordset3.Movenext
			WEND
			pwcoRecordset2.MoveNext

			ProfitLoss = 0		
			IF AuditFees = "" THEN
				ProfitLoss = 0 - OverallHourCharge
			ELSE
				ProfitLoss = AuditFees - OverallHourCharge
			END IF
			Response.Write("<tr>")
			Response.Write("<td>")
			Response.Write("&nbsp;")
			Response.Write(JobNo)
			Response.Write("</td>")		
			Response.Write("<td>")
			Response.Write(ClientName)
			Response.Write("</td>")		
			Response.Write("<td>")
			Response.Write(JobPeriod5)
			Response.Write("</td>")
			Response.Write("<td>")
			Response.Write(ManagerName)
			Response.Write("</td>")
			Response.Write("<td>")			
			Response.Write(AuditFees)
			Response.Write("</td>")
			Response.Write("<td>")			
			Response.Write(OverallHourCharge)
			Response.Write("</td>")
			Response.Write("<td>")			
			Response.Write(ProfitLoss)
			Response.Write("</td>")
			Response.Write("</tr>")
		END IF
		pwcoRecordset1.MoveNext
	WEND
	pwcoConnection.Close
    Set pwcoConnection = Nothing
	pwcoConnection1.Close
    Set pwcoConnection1 = Nothing
%>
</table>
</body>
</html>
actually, the whole thing can run. but the output is only half, then the error message will appear on top of the page. in other words, I would expect more result.
Thanks in advance.
Reply With Quote