Can anyone help me with the following, when I try to write the PC name to a SQL database I get the message that column names are not permitted only variables, what's wrong with my code? I suspect it's the formatting of the (objComputer). Many thanks
'Read Machine Name
Set objComputer = CreateObject("Shell.LocalMachine")
SQLQuery = "insert into Audit_Table (MachineName) values(objComputer)"
objRSSQL.Open SQLQuery, objConn
Wscript.Echo "Done
'Read Machine Name
Set objComputer = CreateObject("Shell.LocalMachine")
SQLQuery = "insert into Audit_Table (MachineName) values(objComputer)"
objRSSQL.Open SQLQuery, objConn
Wscript.Echo "Done