Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Text from database into text box on web.


  • Please log in to reply

#1
Welshhobo

Welshhobo

    Member

  • Member
  • PipPip
  • 29 posts
Anyone know how to get text in a record in a database to copy+paste into a text box on a webpage using visual basic, like the one i typed in to type this post?
I need it to upload customer addresses into my server through a form on the websites control panel :<
Really boring stuff if i do it manually.

I can do the majority of the script myself, i just have no idea how i would get text to copy into a text box in a browser.

Edited by Welshhobo, 06 August 2010 - 08:48 AM.

  • 0

Advertisements


#2
W-Unit

W-Unit

    Member

  • Member
  • PipPipPip
  • 170 posts
I had a similar program I wrote not too long ago. My solution was... tacky, to make an understatement, but I'll describe it and you can see if you're interested. I used C#, but you should be able to migrate my approach over to visual basic pretty easily.
What I did was, I made a browser window inside the GUI that would open up, by default, to the page where the information was to be entered. Once all the data was ready and the user was on the correct page, they would click a button in the GUI. They would then have something like 10 seconds to click on the little "text box," if you will, in the browser window, where the program was to enter the data. After waiting for 10 seconds, the program would call the System.Windows.Forms.SendKeys method, which effectively just emulates keyboard input, to perform the data entry.

If you don't want to make a GUI with a browser window inside of it, you could just as easily apply this method to a regular browser window that the user already has open. You could even make my program type something into Notepad without changing anything. The only catch is, it's up to the user to see that, when the time comes, the emulated keyboard input goes to the right place.
However, I must warn you, I could NOT, for the life of me, figure out how to make the program work without using a System.Windows.Forms.Timer, which of course necessitates the use of a GUI to some degree. Any approach I tried that did NOT use a Timer (and I tried a great many, even going into some pretty advanced stuff with threading), would cause the program to hang during the 10 second delay.

If you like this idea, read up on the following topics:
System.Windows.Forms.SendKeys
System.Windows.Forms.Timer
Windows Forms Programming (using MS Visual Basic of course)
Events Programming (required to make proper use of the timer)

Based on the confidence you had in your post, I don't think it will take you long at all to learn everything you need by looking those things up. If I'm wrong, though, just reply and let me know where specifically you need help in using this approach :)
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP