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
error when try to execute a procedure Operand type clash: varchar is incompatible with cursor
Can I assign a recipient policy for distribution groups?
How to get a website indexed into google quicker?
I AM LOSING HARD DISK SPACE EVERY FEW SECONDS. NO TECHNICIAN HAS FIGURED IT OUT YET
Multi-table Query
Spydawn Spyware / Virus Removal
Added mirroring to MS Server 2003 and now problems.
Exchange 2007 not recieving emails in!
Gotcha's & Rollbacks for raising AD 2003 Interim to Native mode
How can I call my own function inside the AJAX/jQuery $.get() method?