Page 1 of 3 123>
Topic Options
#100947 - 2003-05-14 03:30 AM Looking for ideas...
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
One of my tasks every month is to type in a bunch of data (that is already in an Access Database) into a web based form, and once all the data is entered, the web application displays information that I need to enter into the database.

Has anyone ever tried scripting something like this. My thoughts have been to try to do this in vb editor in Access itself... but I am much more comfortable in KiXtart.

I'm just looking for some ideas or thoughts from someone who might have done something like this.

[ 14. May 2003, 03:44: Message edited by: Al_Po ]

Top
#100948 - 2003-05-14 03:51 AM Re: Looking for ideas...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
You thinking about bypassing the web interface altogether, and updating the database directly ? Or automating the data entry on the web page, then screen scraping the results back into your database ?

-Shawn

Top
#100949 - 2003-05-14 03:54 AM Re: Looking for ideas...
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Unfortunately I do not have direct access to the web database, so yes I would like to automate the data entry and then somehow extract the data it returns, to put it into the Access DB.

[ 14. May 2003, 04:05: Message edited by: Al_Po ]

Top
#100950 - 2003-05-14 04:19 AM Re: Looking for ideas...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Trying to think of a quick start to this, this is the only thing i could think of. It calls up Google and datafills the query textbox with the string "Kixtart Scripting". The IE form isn't focused to by default, so might have to switch-over to it to see the results ...

Break On

$URL = "http://216.239.39.101/"

$IE = CreateObject("InternetExplorer.Application")

$IE.Visible = 1

$IE.Navigate($URL)

While $IE.Busy and $IE.ReadyState <> 4 and @ERROR = 0 Loop

$IE.Document.getElementById("q").Value = "Kixtart Scripting"

Exit 0

Its a start I guess...

-Shawn

[ 14. May 2003, 04:19: Message edited by: Shawn ]

Top
#100951 - 2003-05-14 04:22 AM Re: Looking for ideas...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hey, theres a almost identical discussion going on here
Top
#100952 - 2003-05-14 04:31 AM Re: Looking for ideas...
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Yeah, saw the other post too... watching for ideas there too... [Wink]

quote:
$IE.Document.getElementById("q").Value = "Kixtart Scripting"

Okay... I understand the what the result is... it is typing in "Kixtart Scripting" but can you explain the getElementbyID("Q") part? I can't seem to find anything about it at MS

Top
#100953 - 2003-05-14 04:40 AM Re: Looking for ideas...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
The way I did this was to view source on the Google page, and I noted the "ID" of the query textbox on Google, heres the line:

code:
<input maxLength=256 size=55 name=q ...

Its the "name=" thats important, thats the programmatic identifier for the input textbox on google. GetElementbyID basically gets any element by its identifier (everything in DHTML is an element), it returns it as an control object, and from past experience, most every control has a Value property. Heres a quick link to GetElementById

GetElementByID

Its important to use the Document object for all this stuff, that is where all the good stuff is, heres a link on that:

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/obj_document.asp

-Shawn

[ 14. May 2003, 04:45: Message edited by: Shawn ]

Top
#100954 - 2003-05-14 04:57 AM Re: Looking for ideas...
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Thanks for the good links [Smile] ...amazing how you can search MSDN and never come across the same documents. [Roll Eyes]

You've given me some good ideas on the input of data in IE. I will play with this.

Have any ideas on how I would extract the data it gives me? Basically it returns a sentence of data outlined by a box.

I'm pretty sure I've seen some Access Functions in the UDF section, so hopefully that will make the Access queries easier.

Top
#100955 - 2003-05-14 05:04 AM Re: Looking for ideas...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Yeah, I would say the Access issues were the least of your concerns, think the big thing you have to find out is "how does the data in this web form of yours, get sent back to the webh server". Is just using the plain-old POST technique or is it using some fancy-smancy client-side Java scripting ... hopefully if its the former, you could just bundle all your data up and send it in a post, then screen scrap the results using GetElementByID ... heres a link to a script that issues a post and parses the resulting HTML to look for Stock Quotes of all things. Check out a few posts down ... this script still works believe it or not. It queries a my own broker up here in Canada.

Stock Quotes

Top
#100956 - 2003-05-14 05:17 AM Re: Looking for ideas...
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Thanks for the ideas Shawn. I'll give this a try and see what happens.

I'll keep ya posted if you are interested.

Thanks again.

Top
#100957 - 2003-05-14 05:24 AM Re: Looking for ideas...
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
One more question...

In your script above... how would you tell IE to press "enter" to actually do the search?

Top
#100958 - 2003-05-14 05:24 AM Re: Looking for ideas...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
this sounds nice...
is there linky to the site as it might just happen to be easy to collect the data with simple xmlhttp-code...
_________________________
!

download KiXnet

Top
#100959 - 2003-05-14 05:33 AM Re: Looking for ideas...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Theres the man, jlo !

Do the click ? Something like this maybe...

$IE.Document.GetElementById("btnG").Click()

-Shawn

Top
#100960 - 2003-05-14 05:37 AM Re: Looking for ideas...
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
[Eek!] Works, Awesome! You da man!
Top
#100961 - 2003-05-14 06:10 AM Re: Looking for ideas...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that is still GUI-code [Frown]

createobject('me.sad')
_________________________
!

download KiXnet

Top
#100962 - 2003-05-14 02:48 PM Re: Looking for ideas...
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Hate to barge in here... [Wink]

However..

quote:

Unfortunately I do not have direct access to the web database...

What about ODBC? I know it is kinda clunky, but an idea.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#100963 - 2003-05-14 02:55 PM Re: Looking for ideas...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
odbc?
dunno what you mean but if he has no direct access then you suggest he would take a direct connect?
_________________________
!

download KiXnet

Top
#100964 - 2003-05-14 02:58 PM Re: Looking for ideas...
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Like I said it is an idea.. It maybe in a location unknown to him.. It maybe protected.. He may, however be able to find it..

Just an idea..

But, let's say for a second he knows where it is and it is a MDB file, he could connect to it via ODBC and do what he needs..

Kent

[ 14. May 2003, 15:04: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#100965 - 2003-05-14 04:19 PM Re: Looking for ideas...
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
I have stumbled across a problem...

I need to select "UserID Only - No NT/AD" (bottom most selection in code below) which is a choice in a radio select. I've tried:

$IE.Document.getElementById("NTExchange").select = "None"
$IE.Document.getElementById("NTExchange").value = "None"

and a few others where I just guessed (Click, Checked). [Confused]

any ideas?

code:
 <table border="2" bgcolor="antiquewhite" bordercolor="brown" width="90%" height="140" cellpadding="5">
<tr>
<td align="left">
<b>Type of account to create</b><br><hr>
<input name="NTExchange" type="radio" style="border:none" value="NT" OnClick="ClearValues()" checked>NT/AD account only<br>
<input name="NTExchange" type="radio" style="border:none" value="Both" OnClick="ClearValues()" >NT/AD & Exchange Account<br>
<input name="NTExchange" type="radio" style="border:none" value="Exchange" OnClick="OpenSelect(1)" >Exchange Account Only
<input type="text" style="border:none" name="NTUserID1" size="10" value="" disabled>
<input type="hidden" name="NTUserID" size="10" value="">
<br>
<input type="hidden" name="NTDomainID" value="">
<input type="hidden" name="NTDomain" value="">
<input name="NTExchange" type="radio" style="border:none" value="None" OnClick="ClearValues()" >UserID Only - No NT/AD account
</td>
</tr>
</table>


Top
#100966 - 2003-05-14 04:25 PM Re: Looking for ideas...
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Thanks for the idea Kent, but no, I have no idea if this is a Oracle,SQL, Access db or where it is residing. Most of that info, I believe, is hidden in the asp code.
Top
Page 1 of 3 123>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.103 seconds in which 0.04 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org