Ready to get started?

Download a free trial of the Reckon Data Provider to get started:

 Download Now

Learn more:

Reckon Accounting Icon Reckon ADO.NET Provider

Complete read-write access to Reckon enables developers to search (Customers, Transactions, Invoices, Sales Receipts, etc.), update items, edit customers, and more, from any .NET application.

Automate Reckon Integration Tasks from PowerShell



Are you in search of a quick and easy way to access Reckon data from PowerShell? This article demonstrates how to utilize the Reckon Cmdlets for tasks like connecting to Reckon data, automating operations, downloading data, and more.

The CData Cmdlets for Reckon are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time and bidirectional access to Reckon.

PowerShell Cmdlets or ADO.NET Provider?

The Cmdlets are not only a PowerShell interface to Reckon, but also an SQL interface; this tutorial shows how to use both to create, retrieve, update, and delete Reckon data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Reckon. To access Reckon data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Reckon.

Once you have acquired the necessary connection properties, accessing Reckon data in PowerShell can be enabled in three steps.

When you are connecting to a local Reckon instance, you do not need to set any connection properties.

Requests to Reckon are made through the Remote Connector. The Remote Connector runs on the same machine as Reckon and accepts connections through a lightweight, embedded Web server. The server supports SSL/TLS, enabling users to connect securely from remote machines.

The first time you connect to your company file, you will need to authorize the Remote Connector with Reckon. See the "Getting Started" chapter of the help documentation for a guide.

PowerShell

  1. Install the module:

    Install-Module ReckonCmdlets
  2. Connect:

    $reckon = Connect-Reckon -User "$User" -Password "$Password" -URL "$URL"
  3. Search for and retrieve data:

    $type = "Commercial" $customers = Select-Reckon -Connection $reckon -Table "Customers" -Where "Type = `'$Type`'" $customers

    You can also use the Invoke-Reckon cmdlet to execute SQL commands:

    $customers = Invoke-Reckon -Connection $reckon -Query 'SELECT * FROM Customers WHERE Type = @Type' -Params @{'@Type'='Commercial'}

ADO.NET

  1. Load the provider's assembly:

    [Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Reckon\lib\System.Data.CData.Reckon.dll")
  2. Connect to Reckon:

    $conn= New-Object System.Data.CData.Reckon.ReckonConnection("User=RCUser;Password=RCUserPassword;URL=http://remotehost:8166;") $conn.Open()
  3. Instantiate the ReckonDataAdapter, execute an SQL query, and output the results:

    $sql="SELECT Name, CustomerBalance from Customers" $da= New-Object System.Data.CData.Reckon.ReckonDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.name $_.customerbalance }

Update Reckon Data

PowerShell

Update-Reckon -Connection $Reckon -Columns @('Name','CustomerBalance') -Values @('MyName', 'MyCustomerBalance') -Table Customers -Id "MyID"

ADO.NET

$cmd = New-Object System.Data.CData.Reckon.ReckonCommand("UPDATE Customers SET Type='Commercial' WHERE ID = @myID", $conn) $cmd.Parameters.Add((New-Object System.Data.CData.Reckon.ReckonParameter("@myID","10456255-0015501366"))) $cmd.ExecuteNonQuery()

Insert Reckon Data

PowerShell

Add-Reckon -Connection $Reckon -Table Customers -Columns @("Name", "CustomerBalance") -Values @("MyName", "MyCustomerBalance")

ADO.NET

$cmd = New-Object System.Data.CData.Reckon.ReckonCommand("INSERT INTO Customers (Type) VALUES (@myType)", $conn) $cmd.Parameters.Add((New-Object System.Data.CData.Reckon.ReckonParameter("@myType","Commercial"))) $cmd.ExecuteNonQuery()

Delete Reckon Data

PowerShell

Remove-Reckon -Connection $Reckon -Table "Customers" -Id "MyID"

ADO.NET

$cmd = New-Object System.Data.CData.Reckon.ReckonCommand("DELETE FROM Customers WHERE ID=@myID", $conn) $cmd.Parameters.Add((New-Object System.Data.CData.Reckon.ReckonParameter("@myID","001d000000YBRseAAH"))) $cmd.ExecuteNonQuery()