This code should get you started. You will need to create a system DSN on each machine to get it to report to your database. I can give you code to do that.
You can run code throughout this connection, so you can gather data using various script components, and then come back to this connection and add data to the table since it is not updated until you use the Update line.
Each time you need a new table, you have to close the existing connection and reopen another one using a different query.
'=======================================
Set objConn = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.Recordset")
objConn.Open "DSN=YourDSNNameHERE;"
objRS.CursorLocation = 3
objRS.Open "SELECT * FROM YOURTABLE", objConn, 3, 3
objRS.AddNew
'start your asset queries here.
'everytime you capture an asset name or type, pass it to
'a variable, and use this sort of line...
objRS("FieldName") = strYourVariable
'when you are done getting data, update the table (record)
objRS.Update
objRS.Close
objConn.Close
'==========================================
mmcdonal
|