Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell Field called Password will not update

$
0
0

Hi All,

Having fun this week with SQL commands - I cannot get the bolded text work to update a column named Password in an excel file. If the column is called "uPassword" then it is fine. I tried the Grave ` quote to get around it but does not work.

Seems maybe Password is a reserved word.

Does anyone have any Ideas'

$Batches = 1003, 1004

ForEach ($Batche in $Batches){

$Batche
$strQuery = "Update [$strSheetName] set DisplayName = 'NEw Display name', Password = 'mypassword' Where Batch = $Batche AND Email = $var1"
$objConn = New-Object System.Data.OleDb.OleDbConnection("$strProvider;$strDataSource;$strExtend")
$sqlCommand = New-Object System.Data.OleDb.OleDbCommand($strQuery)
$sqlCommand.Connection = $objConn
$objConn.open()
$sqlCommand.ExecuteNonQuery()
$objConn.Close()

}



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>