I have been working on a basic asset management app whereby an .ASP page is loaded at login and the webserver then uses WMI to retrieve information about the PC (memory, speed etc.) I also use session variables such as hostname and username which also get posted in the database.
The problem I have run into is that if there is a DNS problem then the script will not run. I have set up scavenging to keep the DNS records more up to date but there are still times when the odd PC slips through the net.
I would like to gather all the information clientside then post that but I don't know how to connect to the database. In ASP it would be:
<%
Set DB = Server.CreateObject("ADODB.Connection")
Set TBL = Server.CreateObject("ADODB.RecordSet")
DB.Mode = adModeReadWrite
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + Server.MapPath("../directory/userdb.mdb"))
TBL.Open "INSERT INTO Names (FirstName, Surname) VALUES ('Ed', 'Mozley')", DB
Set TBL=Nothing
Set DB=Nothing
%>
Is it possible to do something similar in vbscript and if so what would be the equivalent? I think once I've got the basics all the other WMI stuff should fall into place.
Thanks very much
Ed
The problem I have run into is that if there is a DNS problem then the script will not run. I have set up scavenging to keep the DNS records more up to date but there are still times when the odd PC slips through the net.
I would like to gather all the information clientside then post that but I don't know how to connect to the database. In ASP it would be:
<%
Set DB = Server.CreateObject("ADODB.Connection")
Set TBL = Server.CreateObject("ADODB.RecordSet")
DB.Mode = adModeReadWrite
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + Server.MapPath("../directory/userdb.mdb"))
TBL.Open "INSERT INTO Names (FirstName, Surname) VALUES ('Ed', 'Mozley')", DB
Set TBL=Nothing
Set DB=Nothing
%>
Is it possible to do something similar in vbscript and if so what would be the equivalent? I think once I've got the basics all the other WMI stuff should fall into place.
Thanks very much
Ed