Web Browser Control

V

Vic Spainhower

Hello,

I would like to use the Web Browser Control to drive a website from an
Access 2002 database. I'd like to bring up a form and when the user hits a
button it would automaticly feed and navigate the web site based on what's
on the form. However, I haven't been able to find much documentation on the
control so I don't know if it's possible or not. If not VBA can it be done
using VB6?

Any help or comments would certainly be appreciated!


Vic
 
A

Arvin Meyer

I would like to use the Web Browser Control to drive a website from an
Access 2002 database. I'd like to bring up a form and when the user hits a
button it would automaticly feed and navigate the web site based on what's
on the form. However, I haven't been able to find much documentation on the
control so I don't know if it's possible or not. If not VBA can it be done
using VB6?

There used to be a bug in this control (I have now idea whether or not it is
still there because I always use the work around) After placing the control
on a form, resize it, then save and close the form. Reopen the form then
once again resize the control and save it. Now it's ready for the code.

Really only 2 things to remember:

1. When loading the form, bring up a website in the on load event to avoid a
blank browser or an error.
2. Use the .Navigate property to move to where you want

Private Sub Form_Load()
With Me.ActiveXCtl0
.Navigate "http://www.datastrat.com/"
End With
End Sub

Private Sub cmdNavigate_Click()
If Not IsNull(Me.txtURL) Then
With Me.ActiveXCtl0
.Navigate Me.txtURL
End With
End If
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
V

Vic Spainhower

Arvin,

Thanks for the reply but this doesn't really answer my question. I am able
to use the control and navigate to specific websites but what I want to do
is once I've established a connection on a particular web site I want to
programmatically enter data onto the web site from the database. Is this
possible?

Vic
 
A

Arvin Meyer

I'd guess that the answer is yes, but it may be ugly. The only thing that
comes to mind is the use of the SendKeys statement. As you probably know,
SendKeys is not a great method due to sometimes unexpected results. The only
other possibility are client side scripts which are built into the web page
itself. After that, I'm not sure because I can't guarantee where the focus
will be. Here's a JavaScript (which I didn't write) which puts the focus in
the search field in the Search page on the websites listed in my sig.

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function putFocus(formInst, elementInst) {
if (document.forms.length > 0) {
document.forms[formInst].elements[elementInst].focus();
}
}
// The second number in the "onLoad" command in the body
// tag determines the form's focus. Counting starts with '0'
// End -->
</script>
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
V

Vic Spainhower

Arvin,

I was hoping for a nice robust way of pushing the information to the web
site. The program is intended to lock loans on various investor web sites
and all of the information required for the lock is in the database. If I
were able to push the information to the web site it would eliminate a
person having to sit there and do it manually. I agree that using SendKeys
could be problematic and by the nature of the application it must be bullet
proof.

Thanks for the input,

Vic





Arvin Meyer said:
I'd guess that the answer is yes, but it may be ugly. The only thing that
comes to mind is the use of the SendKeys statement. As you probably know,
SendKeys is not a great method due to sometimes unexpected results. The only
other possibility are client side scripts which are built into the web page
itself. After that, I'm not sure because I can't guarantee where the focus
will be. Here's a JavaScript (which I didn't write) which puts the focus in
the search field in the Search page on the websites listed in my sig.

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function putFocus(formInst, elementInst) {
if (document.forms.length > 0) {
document.forms[formInst].elements[elementInst].focus();
}
}
// The second number in the "onLoad" command in the body
// tag determines the form's focus. Counting starts with '0'
// End -->
</script>
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

Vic Spainhower said:
Arvin,

Thanks for the reply but this doesn't really answer my question. I am able
to use the control and navigate to specific websites but what I want to do
is once I've established a connection on a particular web site I want to
programmatically enter data onto the web site from the database. Is this
possible?

Vic


hits be
done it avoid
 
A

Arvin Meyer

Rather than "pushing" the data onto the website, why not write an asp page
that returns the information requested by the browser control?
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

Vic Spainhower said:
Arvin,

I was hoping for a nice robust way of pushing the information to the web
site. The program is intended to lock loans on various investor web sites
and all of the information required for the lock is in the database. If I
were able to push the information to the web site it would eliminate a
person having to sit there and do it manually. I agree that using SendKeys
could be problematic and by the nature of the application it must be bullet
proof.

Thanks for the input,

Vic





Arvin Meyer said:
I'd guess that the answer is yes, but it may be ugly. The only thing that
comes to mind is the use of the SendKeys statement. As you probably know,
SendKeys is not a great method due to sometimes unexpected results. The only
other possibility are client side scripts which are built into the web page
itself. After that, I'm not sure because I can't guarantee where the focus
will be. Here's a JavaScript (which I didn't write) which puts the focus in
the search field in the Search page on the websites listed in my sig.

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function putFocus(formInst, elementInst) {
if (document.forms.length > 0) {
document.forms[formInst].elements[elementInst].focus();
}
}
// The second number in the "onLoad" command in the body
// tag determines the form's focus. Counting starts with '0'
// End -->
</script>
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

Vic Spainhower said:
Arvin,

Thanks for the reply but this doesn't really answer my question. I am able
to use the control and navigate to specific websites but what I want
to
from
an user
hits documentation
on not
it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top