Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retrieving data from access database with vbscript??

Status
Not open for further replies.

hskr4evr

Technical User
Sep 17, 2002
35
US
I would like to know how to retrieve data from an access database with vbscript. Lets say my table, in the database, is called ComputerNames and has two fields. ComputerID and Computer. I know what Computer is, but I want the value of ComputerID.

How would I do that with vbscript?? I thought the below would work, but no luck... I'm thinking the code needs to change, but don't know exactly what to change.

strComputer = "HELLO12"
set oRS = oConn.Execute("SELECT ComputerID FROM ComputerNames WHERE ComputerName = '" & strComputer & "'")
intID = oRS("ComputerID").Value
oRS.Close
 
First you need to be on the server side of things incase you did not know. ASP in general.

this may help you out in getting going.

you can step through the examples here from display to inserting data.

Tarwn also wrote a very good FAQ also that touches on the major database interactions
faq333-2120

hope that helps out Just a suggestion: faq183-874
admin@onpntwebdesigns.com
 
I don't see where you established you database connection.

Assuming that was handled properly in the logic above the area you listed in your question above, you would then correct "WHERE ComputerName" to read "WHERE Computer" instead.

You did say the fields are called ComputerID and Computer, right?

It's often the little stuff that seems to take up all your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top