473,385 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

VBScript compilation error '800a03f6' expected end

12
Hello everyone,
I am attempting to add a function to an existing ASP page. The default script of the page is VBScript. The page is returning the following error:


Microsoft VBScript compilation [font=Arial][size=2]error '800a03f6'[/size][/font][font=Times New Roman][size=3] [/size][/font]

[font=Arial][size=2]Expected 'End'[/size][/font]

[font=Arial][size=2]/BatchReportCRInfo2.asp[/size][/font][font=Arial][size=2], line 319[/size][/font] else DL=cint(dispersion_lower)^I know these errors aren't always what they say they are, but I guess I should start with the obvious. Here is the code for the function, starting with line 316. This is my first time posting so I hope I do it right.

Expand|Select|Wrap|Line Numbers
  1. function dspchk(QDispersion,dispersion_lower,dispersion_upper)
  2.    if QDispersion>0 then QD=cint(QDispersion)
  3.       if (isNull(dispersion_lower) or rtrim(dispersion_lower)="") then DL=0
  4.          else DL=cint(dispersion_lower)
  5.       end if
  6.       if (isNull(dispersion_upper) or rtrim(dispersion_upper)="" or dispersion_upper=0) then DU=5
  7.          else DU=cint(dispersion_upper)
  8.       end if
  9.       if (DL>QD or QD>DU) then dspchk="<font color=red><b>OOS: " & QD & "</b></font>"
  10.          else dspchk=QD
  11.       end if
  12.    else dspchk=QDispersion
  13.    end if
  14. end function
  15.  
Thanks in advance for your help!
Nov 15 '07 #1
13 6920
mdock
12
Sorry, I forgot the HTML tags around the error. Here it is:

[HTML]



<font face="Arial" size=2>
<p>Microsoft VBScript compilation </font> <font face="Arial" size=2>error '800a03f6'</font>
<p>
<font face="Arial" size=2>Expected 'End'</font>
<p>
<font face="Arial" size=2>/BatchReportCRInfo2.asp</font><font face="Arial" size=2>, line 319</font>
<pre>else DL=cint(dispersion_lower)
^</pre> [/HTML]
Nov 15 '07 #2
mdock
12
[font=Verdana][size=2]OK, well, maybe not. I'm going to try one more time:[/size][/font]
[font=Verdana][/font]
<FONT face=Verdana size=2>[HTML]



Microsoft VBScript compilation error '800a03f6'

Expected 'End'

/BatchReportCRInfo2.asp, line 319 else DL=cint(dispersion_lower)^[/HTML]
Nov 15 '07 #3
jhardman
3,406 Expert 2GB
If I'm reading it right, these three lines look wrong.
Expand|Select|Wrap|Line Numbers
  1.       if (isNull(dispersion_lower) or rtrim(dispersion_lower)="") then DL=0
  2.          else DL=cint(dispersion_lower)
  3.       end if
  4.  
  5.  
If...else statements that are on more than one line should be in the form :
Expand|Select|Wrap|Line Numbers
  1. if (condition) then
  2.    '(code to execute)
  3. else
  4.    '(code to execute)
  5. end if
Yours looks like it is halfway between this and a single-line if statement:
Expand|Select|Wrap|Line Numbers
  1. if (condition) then (code to execute)
notice if you put the code to execute on the same line as the if and condition, there is no end if (I didn't think you could use "else" either, but I could be wrong. Let me know if this helps.

Jared
Nov 19 '07 #4
mdock
12
Jared,
Thanks so much for your reply. I reformatted the code to match the format you suggested, but I am still getting the error.
Just for the record, my code now looks like this:
Expand|Select|Wrap|Line Numbers
  1. function dspchk(QDispersion,dispersion_lower, dispersion_upper)
  2. if QDispersion>0 then
  3.     QD=cint(QDispersion)
  4.     if (isNull(dispersion_lower) or rtrim(dispersion_lower)="") then
  5.         DL=0
  6.      else
  7.         DL=cint(dispersion_lower)
  8.     end if
  9.     if (isNull(dispersion_upper) or rtrim(dispersion_upper)="" or dispersion_upper=0) then
  10.         DU=5
  11.      else
  12.         DU=cint(dispersion_upper)
  13.     end if
  14.     if (DL>QD or QD>DU) then
  15.         dspchk="<font color=red><b>OOS: " & QD & "</b></font>"
  16.      else
  17.         dspchk=QD
  18.     end if
  19. else
  20.     dspchk=QDispersion
  21. end if
  22. end function
  23.  
Nov 20 '07 #5
mdock
12
But, Jared, the error has changed. It is now:
[HTML]
Microsoft JScript runtime error '800a138f'

Object expected

/_ScriptLibrary/DataGrid.ASP, line 403
[/HTML]
Nov 20 '07 #6
mdock
12
Oh and by the way, that space in the word "upper" in line 1 isn't really there, it just showed up that way in the post for some reason.
Thanks!
Nov 20 '07 #7
mdock
12
I have also tried doing it this way:
Expand|Select|Wrap|Line Numbers
  1. function dspchk(QDispersion,dispersion_lower,dispersion_upper)
  2. if QDispersion>0 then
  3.     QD=cint(QDispersion)
  4. else
  5.     dspchk=QDispersion
  6.     exit function
  7. end if
  8. if (isNull(dispersion_lower) or rtrim(dispersion_lower)="") then
  9.      DL=0
  10. else
  11.      DL=cint(dispersion_lower)
  12. end if
  13. if (isNull(dispersion_upper) or rtrim(dispersion_upper)="" or dispersion_upper=0) then
  14.      DU=5
  15. else
  16.      DU=cint(dispersion_upper)
  17. end if
  18. if (DL>QD or QD>DU) then
  19.      dspchk="<font color=red><b>OOS: " & QD & "</b></font>"
  20. else
  21.      dspchk=QD
  22. end if
  23. end function
  24.  
and I still get the "object expected" error. rrrrr...
Nov 20 '07 #8
mdock
12
Here is another thing I have tried. I read somewhere that if one of the commands executed by an if/then/else statement is "end function," there will be problems because it never reads the "end if" and so the statement is not closed properly. Or something like that! So I tried this:
Expand|Select|Wrap|Line Numbers
  1. function dspchk(QDispersion,dispersion_lower,dispersion_upper)
  2. if (isNull(QDispersion) or rtrim(QDispersion)="" or QDispersion="0") then dspchk=QDispersion : exit function
  3. if QDispersion>0 then QD=cint(QDispersion)
  4. if (isNull(dispersion_lower) or rtrim(dispersion_lower)="") then
  5.     DL=0
  6. else
  7.     DL=cint(dispersion_lower)
  8. end if
  9. if (isNull(dispersion_upper) or rtrim(dispersion_upper)="" or dispersion_upper=0) then
  10.     DU=5
  11. else
  12.     DU=cint(dispersion_upper)
  13. end if
  14. if (DL>QD or QD>DU) then
  15.     dspchk="<font color=red><b>OOS: " & QD & "</b></font>"
  16. else
  17.     dspchk=QD
  18. end if
  19. end function
  20.  
Basically just trying to get the "exit function" out of an "else" statement where it would be looking for an "end if." Alas, I still get the "object expected error." But, as you can see, I am trying really hard. ;-)
Nov 20 '07 #9
jhardman
3,406 Expert 2GB
The object expected error is usually a syntax problem. Which line is that?

Jared
Nov 20 '07 #10
mdock
12
The line it is referring to is in the file scriptlibrary/datagrid.asp which says it is copyrighted by Microsoft. (In other words, I didn't write it.) And line 403 is this:

[size=1]strHTML [/size][size=1][color=#0000ff]+= [/color][/size][size=1]eval([/size][size=1][color=#840084]this[/color][/size][size=1].colData[nCol]);

[/size]
Nov 27 '07 #11
mdock
12
sorry:

Expand|Select|Wrap|Line Numbers
  1. strHTML += eval(this.colData[nCol]);
  2.  
  3.  
Nov 27 '07 #12
jhardman
3,406 Expert 2GB
sorry:

Expand|Select|Wrap|Line Numbers
  1. strHTML += eval(this.colData[nCol]);
  2.  
  3.  
hmm. Any idea what is being passed to nCol?

Jared
Nov 28 '07 #13
mdock
12
Well, where it is performing this function is in a grid, and here is the code which produces that column of the grid:

Expand|Select|Wrap|Line Numbers
  1. Grid1.colAttributes[4] = ' align=center';
  2. Grid1.colFormat[4] = '<Font Size=2 Face="Arial" Color=Black >';
  3. Grid1.colData[4] = 'dspchk(rsProduction.fields.getValue(\'QDispersion\'),rsProduction.fields.getValue(\'dispersion_lower\'),rsProduction.fields.getValue(\'dispersion_upper\'))';
  4.  
Those spaces in the code after "QDispersion" and in the middle of "upper" aren't really there, they just appear in the post for some reason.

Here is the other code related to column 4 of the grid:

Expand|Select|Wrap|Line Numbers
  1. Grid1.headerWidth[4] = '';
  2.  
  3. Grid1.colHeader[4] = '\'QDispersion\'';
  4.  
I am just picking out this column because it is the one I have been working on; the other columns remain the same as they were when the page did not return an error.

Thanks!!
Mare
Dec 5 '07 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Matthew Louden | last post by:
I have no idea what's wrong with the following ASP statement: Response.Write "<select name=\"id\">" MS VBScript Compilation error 800a0401 expected end of statement However, if I do the...
3
by: Adam Short | last post by:
Can anyone help? I have all of a sudden started to receive this error on my site! I have no idea what script it is executing, why it is now failing, what is going on?? All I have been able...
6
by: Adam Short | last post by:
Can anyone help? I have all of a sudden started to receive this error on my site! I have no idea what script it is executing, why it is now failing, what is going on?? All I have been able...
11
by: remya1000 | last post by:
While running the program, i'm getting this error Microsoft VBScript compilation error '800a0401' Expected end of statement /admin/currentmonth.asp, line 26 strSQL = "SELECT...
0
by: delaney19 | last post by:
Hi im getting this error on line 5 where i start the sub, and i have no idea why so if anyone could help i would be very gratefull. Imports System Imports System.DirectoryServices Namespace...
5
by: char | last post by:
I can't figure out why I am getting error: Microsoft VBScript compilation '800a0400' SET MyRecordSet = SERVER.CREATEOBJECT("ADODB.RECORDSET") MySQL = "SELECT * FROM ShipSummary (NOLOCK) where...
3
by: Indy | last post by:
Hi, I am new to VB and have some previous programming experiences. Curently working as an IT support person and trying to write a VB 6 script to access apos database and get one of the table's...
2
by: kevinr | last post by:
Hi, I am brand new to VB, and I am trying to deploy Office 2007 on my network here at work. We used part of this script to do another deployment, and I have taken pieces and tried to edit for this...
2
by: sarahj | last post by:
Microsoft VBScript compilation error '800a0401' Expected end of statement /forms/lgctest.asp, line 17 Dim name,municipal position,municipality,address,city,state,zip,email here's my...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.