Computing.Net > Forums > Programming > VB script and access

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB script and access

Reply to Message Icon

Name: littlekatfish2003
Date: October 21, 2008 at 18:42:15 Pacific
OS: Vista
CPU/Ram: Celoron D
Product: Acer
Comment:

Can anyone out there help me with the next few steps on this program that im having to do in my college. I tryed to get my instructor to break it down for me alittle more, but he really didnt know how. Here is the assignment:

Instructions: Create an access database called “blocker.mdb”. The database should contain a single table called “sitelist”. The sitelist table should contain a single text field called “url”. This table will contain urls that the application should block. Create a windows script that opens an Internet Explorer window. Again, you will use the “internetexplorer.application” object. When the user navigates to a new page, your program should open the blocker.mdb database and query to see if the new url the user has chosen is in the database. If it is, make the browser display a message saying that the site has been blocked. Your program should block based on the first part of the string in the database url field. For instance, if www.yahoo.com is in the database, then www.yahoo.com/news should also be blocked. Exit your script when internet explorer exits.

HERE'S WHAT I HAVE SO FAR

Set ie = WScript.CreateObject("internetexplorer.application", "ie_")
ie.visible = true
ie.navigate("www.yahoo.com")

Set appAccess = CreateObject("Access.Application")

Any help would be greatly appreasheated. I have searched the MSDN site, but I can't seem to find all of what I need.
Thanks




Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: October 22, 2008 at 17:23:01 Pacific
Reply:

I tryed to get my instructor to break it down for me alittle more, but he really didnt know how.
Didn't know how to break it down, or didn't know how to do it?

First, you should initialize the Access (and maybe pull up the DB) before you create InternetExplorer.Application.

Second, your "main" body will probably look like this:

done = False
Do Until Done
WScript.Sleep 10000
Loop

Finally, how you go about intercepting the website load is up to you, but I suggest Sub ie_BeforeNavigate2(pDisp, Url, Flags, TargetFrameName, PostData, Headers, Cancel). Just remember, you won't be able to use Cancel = True.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB script and access

HELP with Novell, VB.NET and Access www.computing.net/answers/programming/help-with-novell-vbnet-and-access/12768.html

User input from VB script and pass to Bat www.computing.net/answers/programming/user-input-from-vb-script-and-pass-to-bat/20001.html

VB Script Compare two Text files for Duplicat www.computing.net/answers/programming/vb-script-compare-two-text-files-for-duplicat/20247.html