The database web project in chapter 11 doesn’t seem to work.
I entered the elements correctly, because until actually attempting to run
the application, everything appears as the book examples. However, something
is missing. This project is on a local drive, not a server. It uses visual
Interdev, Vbscript, and an Access Database.
The two errors I keep getting are:
1. Runtime error line 6
Error: expected statement
<script LANGUAGE=”VBScript”>
<!-
function Recordset1_onrowcenter( )
txtDiscountedPrice.value = Recordset1.fields.getvalue(“UnitPrice”) * .90
end function
file://->
</script>
I’m not sure what the problem is here. I omitted the end function command
the first time, but inserted it later and still received the same error.
2. An exception of type ‘htmlfile: unspecified error’ was not handled
Pointing to this line of code:
var strServer = 'http://' + document.domain;
Can I set the path to my local drive, and what would the syntax be for that?
I would appreciate as much help with this as possible. I am a beginner with
Visual InterDev and this project may be too much for my skills. Any ideas
about examples of VI that work with an Access Database that would be simpler
would also be appreciated. Thank you for your help and time.
David Broida
Webmaster
NIT Inc.
(410) 321-6126
www.NITservices.com
jc
David Broida <dbr...@bcpl.net> wrote in message
news:u7yC4.32$Hg6....@news.abs.net...
David Broida wrote:
> In the book Hands on Visual Interdev 6
>
> The database web project in chapter 11 doesn’t seem to work.
>
> I entered the elements correctly, because until actually attempting to run
> the application, everything appears as the book examples. However, something
> is missing. This project is on a local drive, not a server. It uses visual
> Interdev, Vbscript, and an Access Database.
>
> The two errors I keep getting are:
>
> 1. Runtime error line 6
> Error: expected statement
>
> <script LANGUAGE=”VBScript”>
> <!-
> function Recordset1_onrowcenter( )
> txtDiscountedPrice.value = Recordset1.fields.getvalue(“UnitPrice”) * .90
> end function
> file://->
************************************************************
this is mixing client/server script. This is client script - then you are
calling the recordset that is on the server (it don't matter if it is the same
computer or not). Also, there is no such thing as "_onrowcenter( )" - there is
"_onrowenter()" event.
Use the Scripting Object Model and enable it on the ASP page. Then, use the:
thisForm.txtDiscountedPrice.value
syntax. The recordset is an object on the server. They can not talk to one
another (actually they can but it is SERIOUS work). If it is a single value or
limited returned results place a hidden box on the form and read the value.
Example:
<INPUT id=txtSomething name=txtSomething value = "<%
response.write(Recordset1.fields("UnitPrice") %>" style="VISIBILITY: hidden">
Now, call it on the client:
<Script language="VBscript">
sub something_someEvent()
varResult = thisForm.txtSomething.value
varSomeResult = varResult * .90
thisForm.txtRegularResultBox.value = varSomeResult
end sub
> </script>
***********************************************************
>
>
> I’m not sure what the problem is here. I omitted the end function command
> the first time, but inserted it later and still received the same error.
>
> 2. An exception of type ‘htmlfile: unspecified error’ was not handled
>
> Pointing to this line of code:
>
> var strServer = 'http://' + document.domain;
*******************************************************
this is tougher because I do not know the value of document.domain. I do not
know what strServer points to. It SOUNDS like this is another mix-up of
Server/Client code but I am not sure.
Relax, just remember the server and client can only talk at certain times. Very
little talk between the two. Remember where each one is located in your head and
adjust syntax, functions, methods and abilities accordingly. It will get easier.
Vince
p.s. - Books are FAMOUS for BAD code.................
*******************************************************************
been there, done that, bought the t-shirt.
They don't give tech support at all, you have to post to their messages
area. I emailed the publisher of the book, and surprise, no response.
Strider wrote in message ...
>www.asp101.com
>
>jc
>David Broida <dbr...@bcpl.net> wrote in message
>news:u7yC4.32$Hg6....@news.abs.net...
>> In the book Hands on Visual Interdev 6
>>
>> The database web project in chapter 11 doesn't seem to work.
>>
>> I entered the elements correctly, because until actually attempting to
run
>> the application, everything appears as the book examples. However,
>something
>> is missing. This project is on a local drive, not a server. It uses
visual
>> Interdev, Vbscript, and an Access Database.
>>
>> The two errors I keep getting are:
>>
>> 1. Runtime error line 6
>> Error: expected statement
>>
>> <script LANGUAGE="VBScript">
>> <!-
>> function Recordset1_onrowcenter( )
>> txtDiscountedPrice.value = Recordset1.fields.getvalue("UnitPrice") * .90
>> end function
>> file://->
>> </script>
>>
>> I'm not sure what the problem is here. I omitted the end function command
>> the first time, but inserted it later and still received the same error.
>>
>>
>> 2. An exception of type 'htmlfile: unspecified error' was not handled
>>
>> Pointing to this line of code:
>>
>> var strServer = 'http://' + document.domain;
>>
Vince F wrote in message <38DBF035...@usa.net>...
>Please see included comments below:
>
>
>
>David Broida wrote:
>
>> In the book Hands on Visual Interdev 6
>>
>> The database web project in chapter 11 doesn’t seem to work.
>>
>> I entered the elements correctly, because until actually attempting to
run
>> the application, everything appears as the book examples. However,
something
>> is missing. This project is on a local drive, not a server. It uses
visual
>> Interdev, Vbscript, and an Access Database.
>>
>> The two errors I keep getting are:
>>
>> 1. Runtime error line 6
>> Error: expected statement
>>
>> <script LANGUAGE=”VBScript”>
>> <!-
>> function Recordset1_onrowcenter( )
>> txtDiscountedPrice.value = Recordset1.fields.getvalue(“UnitPrice”) * .90
>> end function
>> file://->
>
>> I’m not sure what the problem is here. I omitted the end function command
>> the first time, but inserted it later and still received the same error.
>>
>> 2. An exception of type ‘htmlfile: unspecified error’ was not handled
>>
>> Pointing to this line of code:
>>
>> var strServer = 'http://' + document.domain;
>
>*******************************************************
>this is tougher because I do not know the value of document.domain. I do
not
>know what strServer points to. It SOUNDS like this is another mix-up of
>Server/Client code but I am not sure.
>
>Relax, just remember the server and client can only talk at certain times.
Very
>little talk between the two. Remember where each one is located in your
head and
>adjust syntax, functions, methods and abilities accordingly. It will get
easier.
>
>Vince
>
>
>p.s. - Books are FAMOUS for BAD code.................
>
>
>*******************************************************************
>
> They don't give tech support at all, you have to post to their messages
> area. I emailed the publisher of the book, and surprise, no response.
I like the Wrox press books and they do give technical support - at least as
far as posting the errata on their site. Because of this I've always been able
to get the code to work quickly for all Wrox books. I think that "Professional
InterDev 6 Programming" by Ian Blackburn is an excellent book.
I had a similar problem to yours with "Visual InterDev 6 Unleashed" - SAMS -
although the book is OK it was spoilt by some typos and I spent ages trying to
get the main project code to work. A page of errata on their web site or a
respone to my emails would have saved me hours - but most publishers are more
interested in enticing you with useless CDs that with support.
Good luck with the VI - I think it has more bugs than a termites nest - still
worth using for the database integration but perhaps the DTCs and SOM are best
left alone until version 3 comes out this summer - when, perhaps, microsoft
would have exterminated those bugs.