Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Fri, 8 Feb 2008 02:40:00 -0800,    group: microsoft.public.inetsdk.programming.webbrowser_ctl        back       


Error triggered by navigation   
I have a program written in MS Access that incorporates the WebBrowser 
control. The program has been running fine for many months until all of a 
sudden, I started getting an error dialog which states: "An error has 
occurred. Do you want to debug? Line: 1, Error: syntax error". I can either 
click Yes or No. Either way, the same box comes up a second time. This 
repeats with the execution of every ststement that attempts to navigate from 
1 page to another. When I respond to the dialog, navigation does take place. 
However, hundreds of navigation attempts are made with each session and it is 
just impractical to do all that clicking.

Anyone here have any ideas why that may be happenning?
date: Fri, 8 Feb 2008 02:40:00 -0800   author:   JonWayn

Re: Error triggered by navigation   
"JonWayn"  wrote in message 
news:11C9E771-F37B-48FB-9989-3C3FC8BC3AF3@microsoft.com...
>I have a program written in MS Access that incorporates the WebBrowser
> control. The program has been running fine for many months until all of a
> sudden, I started getting an error dialog which states: "An error has
> occurred. Do you want to debug? Line: 1, Error: syntax error". I can 
> either
> click Yes or No. Either way, the same box comes up a second time. This
> repeats with the execution of every ststement that attempts to navigate 
> from
> 1 page to another. When I respond to the dialog, navigation does take 
> place.
> However, hundreds of navigation attempts are made with each session and it 
> is
> just impractical to do all that clicking.
>
> Anyone here have any ideas why that may be happenning?

Jon,

Yes, there are errors on the web page you are loading.

Do you control/own the pages that are loading ? If so, then you should 
correct the HTML source of those pages.

If not and this is an external website you are navigating to then most 
likely it has recently changed.

In that case, you can try changing your internet explorer preferences so 
that Disable Script Debugging is checked (for both Internet Explorer and 
other). If this does not do the job then you are going to have to add code 
to the webbrowser control to block the popup dialog.

hth
Leslie.
date: Fri, 8 Feb 2008 20:52:45 +1000   author:   Leslie Milburn

Re: Error triggered by navigation   
Before I even read your reply, I went in a unchecked "Disable script 
debugging (IE)". The other one wasnt checked. So I left them both unchecked 
and tried running my program again. It didnt solve the problem. After reading 
your response, I went back in and checked them both. Now I get a slightly 
different box, just as frequently nonetheless.

I have no control over the contents of the website. Also, if I open IE and 
use the website from the user interface, I do not get those errors.

"Leslie Milburn" wrote:

> 
> "JonWayn"  wrote in message 
> news:11C9E771-F37B-48FB-9989-3C3FC8BC3AF3@microsoft.com...
> >I have a program written in MS Access that incorporates the WebBrowser
> > control. The program has been running fine for many months until all of a
> > sudden, I started getting an error dialog which states: "An error has
> > occurred. Do you want to debug? Line: 1, Error: syntax error". I can 
> > either
> > click Yes or No. Either way, the same box comes up a second time. This
> > repeats with the execution of every ststement that attempts to navigate 
> > from
> > 1 page to another. When I respond to the dialog, navigation does take 
> > place.
> > However, hundreds of navigation attempts are made with each session and it 
> > is
> > just impractical to do all that clicking.
> >
> > Anyone here have any ideas why that may be happenning?
> 
> Jon,
> 
> Yes, there are errors on the web page you are loading.
> 
> Do you control/own the pages that are loading ? If so, then you should 
> correct the HTML source of those pages.
> 
> If not and this is an external website you are navigating to then most 
> likely it has recently changed.
> 
> In that case, you can try changing your internet explorer preferences so 
> that Disable Script Debugging is checked (for both Internet Explorer and 
> other). If this does not do the job then you are going to have to add code 
> to the webbrowser control to block the popup dialog.
> 
> hth
> Leslie. 
> 
> 
>
date: Fri, 8 Feb 2008 03:08:01 -0800   author:   JonWayn

Re: Error triggered by navigation   
"JonWayn"  wrote in message 
news:0B9E35C6-645C-4E36-8B4E-7A6DC482E13A@microsoft.com...
> Before I even read your reply, I went in a unchecked "Disable script
> debugging (IE)". The other one wasnt checked. So I left them both 
> unchecked
> and tried running my program again. It didnt solve the problem. After 
> reading
> your response, I went back in and checked them both. Now I get a slightly
> different box, just as frequently nonetheless.
>
> I have no control over the contents of the website. Also, if I open IE and
> use the website from the user interface, I do not get those errors.
>

Jon,

You may need to implement IOleCommandTarget and in particular the Exec 
function where you can intercept the command which displays script errors by 
default. Heres a code snippet:

HRESULT STDMETHODCALLTYPE Target_Exec(IOleCommandTarget FAR* This,
const GUID __RPC_FAR *pguidCmdGroup,
DWORD nCmdID,
DWORD nCmdexecopt,
VARIANT __RPC_FAR *pvaIn,
VARIANT __RPC_FAR *pvaOut)
{
// See docobj.h for OLECMDID values

if (nCmdID == OLECMDID_SHOWSCRIPTERROR) {
V_BOOL(pvaOut) = VARIANT_TRUE;
return S_OK;
}
return OLECMDERR_E_NOTSUPPORTED; // Let the default handler have it
}

Leslie.
date: Fri, 8 Feb 2008 23:49:58 +1000   author:   Leslie Milburn

Re: Error triggered by navigation   
Great. Now, since I am not using C#, C++, or any variant of the C language, 
(I am using VBA) how do I take advantage of the work-around you present?

Also, another question, since the problem occurs only when I embed the web 
browser control on a form, and not when I open IE as a window, am I likely to 
get the same errors if I wrote this program subclassing IE? I have never used 
that method before, but from readings that I did when learning to use the 
WebBrowser control, there is some other way of automating the use of IE which 
involves creating some object from a class and responding to events that way.

"Leslie Milburn" wrote:

> 
> "JonWayn"  wrote in message 
> news:0B9E35C6-645C-4E36-8B4E-7A6DC482E13A@microsoft.com...
> > Before I even read your reply, I went in a unchecked "Disable script
> > debugging (IE)". The other one wasnt checked. So I left them both 
> > unchecked
> > and tried running my program again. It didnt solve the problem. After 
> > reading
> > your response, I went back in and checked them both. Now I get a slightly
> > different box, just as frequently nonetheless.
> >
> > I have no control over the contents of the website. Also, if I open IE and
> > use the website from the user interface, I do not get those errors.
> >
> 
> Jon,
> 
> You may need to implement IOleCommandTarget and in particular the Exec 
> function where you can intercept the command which displays script errors by 
> default. Heres a code snippet:
> 
> HRESULT STDMETHODCALLTYPE Target_Exec(IOleCommandTarget FAR* This,
> const GUID __RPC_FAR *pguidCmdGroup,
> DWORD nCmdID,
> DWORD nCmdexecopt,
> VARIANT __RPC_FAR *pvaIn,
> VARIANT __RPC_FAR *pvaOut)
> {
> // See docobj.h for OLECMDID values
> 
> if (nCmdID == OLECMDID_SHOWSCRIPTERROR) {
> V_BOOL(pvaOut) = VARIANT_TRUE;
> return S_OK;
> }
> return OLECMDERR_E_NOTSUPPORTED; // Let the default handler have it
> }
> 
> Leslie.
> 
> 
> 
>
date: Sat, 9 Feb 2008 12:50:00 -0800   author:   JonWayn

Re: Error triggered by navigation   
I finally found a solution to that problem. Instead of using the WebBrowser 
control on a form, I am using the InternetExplorer object. It has all the 
same properties and methods, so there was little changes needed. Works fine. 
Thanks for your input.



"Leslie Milburn" wrote:

> 
> "JonWayn"  wrote in message 
> news:0B9E35C6-645C-4E36-8B4E-7A6DC482E13A@microsoft.com...
> > Before I even read your reply, I went in a unchecked "Disable script
> > debugging (IE)". The other one wasnt checked. So I left them both 
> > unchecked
> > and tried running my program again. It didnt solve the problem. After 
> > reading
> > your response, I went back in and checked them both. Now I get a slightly
> > different box, just as frequently nonetheless.
> >
> > I have no control over the contents of the website. Also, if I open IE and
> > use the website from the user interface, I do not get those errors.
> >
> 
> Jon,
> 
> You may need to implement IOleCommandTarget and in particular the Exec 
> function where you can intercept the command which displays script errors by 
> default. Heres a code snippet:
> 
> HRESULT STDMETHODCALLTYPE Target_Exec(IOleCommandTarget FAR* This,
> const GUID __RPC_FAR *pguidCmdGroup,
> DWORD nCmdID,
> DWORD nCmdexecopt,
> VARIANT __RPC_FAR *pvaIn,
> VARIANT __RPC_FAR *pvaOut)
> {
> // See docobj.h for OLECMDID values
> 
> if (nCmdID == OLECMDID_SHOWSCRIPTERROR) {
> V_BOOL(pvaOut) = VARIANT_TRUE;
> return S_OK;
> }
> return OLECMDERR_E_NOTSUPPORTED; // Let the default handler have it
> }
> 
> Leslie.
> 
> 
> 
>
date: Sat, 9 Feb 2008 18:53:00 -0800   author:   JonWayn

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us