Microsoft
Software
Hardware
Network
Question : How to connect to database using Vbscript?
Hello All,
I got a Access Database with Name Zipcodes and i got a html page named Zipcode.html an di got 4 text fields Zip, county, City and State. When the user enter a Zip and tab out of it the remaining fields to be filled by using the database.
Here is my html page:
Zipcode.html
Zip:
County:
City:
State:
Can you tell how to do ? I am new to Vb Script as we can't do in java script.
Thanks in advance
Muddasa
Answer : How to connect to database using Vbscript?
The simplest way i can see to do this is to use ASP.NET VB and set your Zip code field to post back to the server. You'd then create a a dataset upon postback inserting the Zip code the user has submitted into the SQL statement, something along the lines of "SELECT * FROM mydatabasetable WHERE myzipcode = " & TxtZip.text . The other fields are then populated by the results of this query eg within the Sub Page_Load event write the results into the textboxes like 'TxtCity.text = MyDataset.FieldValue("City
", Container)'
If you are unsure of how auto postback works in asp.net, i've included an example below, copy this code below into a page and call it tester.aspx, put in in your wwwroot folder and call it as
http://localhost/tester.as
px
- Make sure you have the .net framework installed on your server though or it wont work!
Zip:
Country:
City:
State:
Random Solutions
New lto 2 tape drive backup exec 8.6 :lto is not an option when selecting media type.
Exchange Information Store a SQL Database?
Multi-Criteria Filter Problem
SQL Server 2005 Express
DFSr and Access Database issues & questions
EXCHANGE 2007 SA and IS services do not start after reboot
xp install does not see a hard drive when bios set to RAID (not IDE)
Task Manager Missing
Fedora Core 6 unable to find volume group "VolGroup00"
Actionscript: show system cursor when XML attribute is blank or null