Client applications
How to work with FreeAgent data in some example applications and programming languages:
LibreOffice
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as LibreOffice.
-
Choose File > New > Database.
-
Choose Connect to an existing database.
-
Choose ODBC in the list, and then choose Next.
-
Choose Browse, double-click your data source, and then choose Next.
-
If your database requires a database user name, enter it in the User name box. If this user needs to supply a password choose the Password required check box.
-
Choose Finish.
-
Save the database when prompted.
The database opens in a new Base window. From here you can access your data.
-
In the left pane of the database window, choose the Tables icon to display a hierarchy of tables. Enter the database password if prompted, and then choose OK.
-
To retrieve the data in a table, in the Tables pane, double-click a table.
-
Choose the Queries icon to create a query.
Use any of the methods listed in the Tasks pane to create a query.
Microsoft Access
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as Access.
-
Choose one of the following ways to work with your FreeAgent data in Access.
Linking a table
-
Open your Microsoft Access database.
-
Choose External Data.
-
In the New Data Source list, choose From Other Sources > ODBC Database.
-
In the Get External Data screen, choose Link to the data source by creating a linked table, and choose OK.
-
In the Select Data Source dialog box, choose the Machine Data Source tab.
-
Choose your Easysoft ODBC-FreeAgent Driver ODBC data source from the Machine Data Source list, and then choose OK.
-
In the Link Tables dialog box, choose the tables that you want to link to, and then choose OK.
Importing a table
-
Open your Microsoft Access database.
-
Choose External Data.
-
In the New Data Source list, choose From Other Sources > ODBC Database.
-
In the Get External Data screen, choose Import the source data into a new table in the current database, and choose OK.
-
In the Select Data Source dialog box, choose the Machine Data Source tab.
-
Choose your Easysoft ODBC-FreeAgent Driver ODBC data source from the Machine Data Source list, and then choose OK.
-
In the Import Objects dialog box, choose the tables you want to import, and then choose OK.
Microsoft Excel
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as Excel.
-
Choose one of the following ways to work with your FreeAgent data in Excel.
Data Connection Wizard
-
Choose Data > Get Data > From Other Sources > From ODBC.
-
Choose your Easysoft ODBC-FreeAgent Driver data source from the list, and then choose OK.
-
Enter the user name and password for your data store if applicable, otherwise enter any text string to get past this stage. Choose Next.
-
Choose the table that contains the data you want to retrieve, and then choose Load.
Microsoft Query
-
Choose Data > Get Data > From Other Sources > From Microsoft Query.
-
In the Choose Data Source dialog box, choose your FreeAgent data source from the list, and then choose OK.
-
In the Query Wizard, choose the columns that contain the data you want to retrieve, and then click Next.
-
If you want to return a subset of the data, use the Filter Data screen to filter the results of your query (this is the equivalent of a SQL
WHERE
clause), and then choose Next. -
If you want to change the sort order of your data, use the Sort Order screen to sort the results of your query (this is the equivalent of a SQL
ORDER BY
clause), and then choose Next. Choose Finish to return your FreeAgent data to Excel.
PowerPivot
-
On the PowerPivot tab, choose Manage.
-
In the PowerPivot window, choose Get External Data > From Other Sources.
-
In the Connect to a Data Source list, choose Others (OLEDB/ODBC)
-
In the Specify a Connection screen, enter a name for your connection in the space provided. Then choose Build.
-
In the Data Link Properties box, choose your Easysoft ODBC-FreeAgent Driver data source from the list, and then choose OK.
-
Choose Next.
-
Choose how to import your FreeAgent data and then choose Finish.
-
Choose Close to return the data to Excel.
Microsoft Power BI
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as Power BI Desktop.
-
In Power BI Desktop, choose Get data from another source.
-
In the Get Data dialog box, choose ODBC, and then choose Connect.
-
In the From ODBC dialog box, choose your FreeAgent data source, and then choose OK.
-
Enter your database user name and password when prompted.
If you make a mistake when entering the user name and password, cancel the connection process. Then in Power BI Desktop Options and Settings, edit the data source. Specify the correct user name or password in the data source credentials dialog box. Otherwise, Power BI Desktop will continue to use the cached incorrect credentials.
If you do not normally need to enter a user name and password, enter some dummy strings in the spaces provided. -
In the Navigator dialog box, choose the tables you want to analyse in Power BI Desktop, and then choose Load.
Your FreeAgent data is now available to use in Power BI visualisations.
Microsoft SQL Server
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as SQL Server.
-
In Microsoft SQL Server Management Studio, connect to the SQL Server instance you want to create the linked server against.
You need to log on with an account that is a member of the SQL Server
sysadmin
fixed server role to create a linked server. -
Right-click Server Objects. From the pop-up menu choose New > Linked Server.
-
In the Linked server box, enter "FreeAgent".
-
From the Provider list, choose Microsoft OLE DB Provider for ODBC drivers.
-
In the Data source box, enter the name of your FreeAgent data source, and then choose OK.
SQL Server verifies the linked server by testing the connection.
-
If you get the error "Specified driver could not be loaded due to system error 126: The specified module could not be found," choose Yes when prompted whether to keep the linked server. You need to restart your SQL Server instance before you can use the linked server. If SQL Server was already running when you installed the Easysoft ODBC-FreeAgent Driver, it will not have the latest version of the System
Path
environment variable. The Easysoft ODBC-FreeAgent Driver Setup program adds entries for the driver to the SystemPath
. Restarting the instance makes these changes available to SQL Server, allowing it to load the Easysoft ODBC-FreeAgent Driver. -
If you made a mistake when specifying the Easysoft ODBC-FreeAgent Driver, you get the error "Data source name not found and no default driver specified." If you get this error, choose No when prompted whether to keep the linked server and edit the value in the Data source box.
-
-
You can query your Easysoft ODBC-FreeAgent Driver data either by using a:
-
Four part table name in a distributed query.
A four part table name has the format:
server_name.[database_name].[schema_name].table_name
For data stores where there is no database or schema, Easysoft ODBC drivers return a "dummy" value for both identifiers, because some ODBC applications expect there to be a database and a schema. To find out the identifier names, run:
EXEC sp_tables_ex @table_server = 'FreeAgent'
Include these identifiers in your SQL statements. For example:
SELECT * FROM [FreeAgent].FREEAGENT.DBO.Bills
The capitalisation of the table name must be the same as it is in the result set returned by
sp_tables_ex
: -
Pass-through query in an
OPENQUERY
function. For example:SELECT * FROM OPENQUERY([FreeAgent], 'SELECT * FROM Bills') EXEC ('INSERT INTO Bills (Contact, Reference, Dated_On, Due_On, Bill_Items) VALUES (''https://api.freeagent.com/v2/contacts/18727314'' , ''YEB021'' , ''2025-01-16'' , ''2025-01-16'' , ''[{"category":"https://api.freeagent.com/v2/categories/291","description":"YEB-line-2-standing-charge","sales_tax_rate":"20","total_value_ex_tax":6.99}]'')') AT FreeAgent UPDATE OPENQUERY ([FreeAgent], 'SELECT Contact FROM Bills WHERE Id = ''31962267''') SET Contact='Standing charges for second line.' DELETE OPENQUERY (FreeAgent, 'SELECT Contact FROM Bills WHERE Id = ''31962267''')
SQL Server sends pass-through queries as uninterpreted query strings to the FreeAgent. This means that SQL Server does not apply any kind of logic to the query or try to estimate what that query will do.
-
Oracle
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as Oracle.
-
Follow the instructions for your Oracle platform.
Connecting FreeAgent to Oracle on Windows
-
Create a DG4ODBC init file on your Oracle machine. To do this, change to the
%ORACLE_HOME%\hs\admin
directory. Create a copy of the fileinitdg4odbc.ora
. Name the new fileinitFreeAgent.ora
.In these instructions, replace %ORACLE_HOME%
with the location of your OracleHOME
directory. For example,C:\oraclexe\app\oracle\product\11.2.0\server
. -
Ensure these parameters and values are present in your init file:
HS_FDS_CONNECT_INFO = "FreeAgent"
Replace
FreeAgent
with the name of your Easysoft ODBC-FreeAgent Driver data source. -
Comment out the line that enables DG4ODBC tracing. For example:
#HS_FDS_TRACE_LEVEL = <trace_level>
-
Add an entry to
%ORACLE_HOME%\network\admin\listener.ora
that creates aSID_NAME
for DG4ODBC. For example:SID_LIST_LISTENER = (SID_LIST = (SID_DESC= (SID_NAME=FreeAgent) (ORACLE_HOME=%ORACLE_HOME%) (PROGRAM=dg4odbc) ) )
-
Add a DG4ODBC entry to
%ORACLE_HOME%\network\admin\tnsnames.ora
that specifies theSID_NAME
created in the previous step. For example:FreeAgent = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle_host)(PORT = 1521)) (CONNECT_DATA = (SID = FreeAgent) ) (HS = OK) )
Replace
oracle_host
with the host name of your Oracle machine. -
Start (or restart) the Oracle Listener:
cd %ORACLE_HOME%\bin lsnrctl stop lsnrctl start
-
Connect to your Oracle database in SQL*Plus.
-
In SQL*Plus, create a database link for FreeAgent. For example:
CREATE PUBLIC DATABASE LINK FreeAgentLink CONNECT TO "dbuser" IDENTIFIED BY "dbpassword" USING 'FreeAgent';
Replace
dbuser
anddbpassword
with your backend user name and password, if applicable. -
Try querying and updating your FreeAgent data. For example:
SELECT "Contact" FROM "Bills"@FreeAgentLink; DECLARE num_rows integer; BEGIN num_rows:=DBMS_HS_PASSTHROUGH.EXECUTE_IMMEDIATE@FreeAgentLink ('INSERT INTO Bills (Contact, Reference, Dated_On, Due_On, Bill_Items) VALUES (''https://api.freeagent.com/v2/contacts/18727314'', ''YEB021'', ''2025-01-16'', ''2025-01-16'', ''[{"category":"https://api.freeagent.com/v2/categories/291","description":"YEB-line-2-standing-charge","sales_tax_rate":"20","total_value_ex_tax":6.99}]'')'); END; / DECLARE num_rows integer; BEGIN num_rows:=DBMS_HS_PASSTHROUGH.EXECUTE_IMMEDIATE@FreeAgentLink ('UPDATE "Bills" SET "Contact" = ''Standing charges for second line.'' WHERE "Id" = ''31962267'''); END; / DECLARE num_rows integer; BEGIN num_rows:=DBMS_HS_PASSTHROUGH.EXECUTE_IMMEDIATE@FreeAgentLink ('DELETE from "Bills" WHERE Id = ''31962267'''); END; /
Notes
-
If you have problems connecting to FreeAgent from Oracle, enable DG4ODBC tracing and check the trace files written to the
%ORACLE_HOME%\hs\trace
directory. To enable DG4ODBC tracing, add the lineHS_FDS_TRACE_LEVEL = DEBUG
toinitFreeAgent.ora
and then start or restart the Oracle listener. If thetrace
directory does not exist, create it. -
If you enable ODBC Driver Manager tracing, but do not get a log file in the location you specify, try looking in the top-level folder (for example,
C:\SQL.log
). Alternatively, in ODBC Data Source Administrator, change the trace file location to the WindowsTEMP
directory.
Go
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as Go.
-
Install the odbc package for Go:
go mod init test go get github.com/alexbrainman/odbc
-
Create and then use Go to run this script, which retrieves some FreeAgent data:
package main import ( "database/sql" _ "github.com/alexbrainman/odbc2" "log" ) func main() { // Replace the DSN value with the name of your ODBC data source. db, err := sql.Open("odbc", "DSN=FreeAgent") if err != nil { log.Fatal(err) } var ( name string ) rows, err := db.Query("SELECT Contact FROM Bills") if err != nil { log.Fatal(err) } defer rows.Close() for rows.Next() { err := rows.Scan(&name) if err != nil { log.Fatal(err) } log.Println(name) } err = rows.Err() if err != nil { log.Fatal(err) } defer db.Close() }
Node.js
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as Node.js.
-
Install the odbc module for Node.js:
npm install odbc
-
Create and then use Node.js to run this script, which retrieves some FreeAgent data:
const odbc = require('odbc'); // Replace FreeAgent with the name of your Easysoft ODBC-FreeAgent Driver // data source. const connection = odbc.connect('DSN=FreeAgent', (error, connection) => { connection.query('SELECT Contact FROM Bills', (error, result) => { if (error) { console.error(error) } console.log(result); }); });
-
This script retrieves the tables and views in your Easysoft ODBC-FreeAgent Driver data source:
const odbc = require('odbc'); const connection = odbc.connect('DSN=FreeAgent', (error, connection) => { connection.tables(null, null, null, null, (error, result) => { if (error) { return; } const util = require('util'); console.log(util.inspect(result, {maxArrayLength: null, depth:null})) }); });
-
This script retrieves the names of the columns in these tables and views:
const odbc = require('odbc'); const connection = odbc.connect('DSN=FreeAgent', (error, connection) => { connection.columns(null, null, null, null, (error, result) => { if (error) { return; } const util = require('util'); console.log(util.inspect(result, {maxArrayLength: null, depth:null})) }); });
-
These scripts insert, update, and then delete some FreeAgent data:
const odbc = require("odbc"); const connection = odbc.connect("DSN=FreeAgent", (error, connection) => { connection.query("INSERT INTO Bills ( Contact, Reference, Dated_On, Due_On, Bill_Items ) VALUES ( 'https://api.freeagent.com/v2/contacts/18727314', 'YEB021', '2025-01-16', '2025-01-16', '[{"category":"https://api.freeagent.com/v2/categories/291","description":"YEB-line-2-standing-charge","sales_tax_rate":"20","total_value_ex_tax":6.99}]' )", (error, result) => { if (error) { console.error(error) } console.log(result); }); }); const odbc = require("odbc"); const connection = odbc.connect("DSN=FreeAgent", (error, connection) => { connection.query("UPDATE Bills SET Contact = 'Standing charges for second line.' WHERE Id = '31962267'", (error, result) => { if (error) { console.error(error) } console.log(result); }); }); const odbc = require("odbc"); const connection = odbc.connect("DSN=FreeAgent", (error, connection) => { connection.query("DELETE FROM Bills WHERE Id = '31962267'", (error, result) => { if (error) { console.error(error) } console.log(result); }); });
Perl
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as Perl.
-
Check whether your Perl distribution supports ODBC:
perl -e 'use DBD::ODBC;'
-
Do one of the following:
-
If you get no output, your Perl distribution supports ODBC. Skip to the next step.
-
If you get:
Can't locate DBD/ODBC.pm
you need to install DBD::ODBC before you can use the Easysoft ODBC-FreeAgent Driver to connect to FreeAgent.
-
-
Create and then use Perl to run this script, which retrieves some FreeAgent data:
use strict; use DBI; # Replace FreeAgent with the name of your Easysoft ODBC-FreeAgent Driver data source. my $dbh = DBI-> connect('dbi:ODBC:FreeAgent'); my $sql = "SELECT Contact FROM Bills"; my $sth = $dbh->prepare($sql) or die "Can't prepare statement: $DBI::errstr"; $sth->execute(); my($Col); # Fetch and display the result set values. while(($Col) = $sth->fetchrow()){ print("$Col\n"); } $dbh->disconnect if ($dbh);
-
This script retrieves the tables and views in your Easysoft ODBC-FreeAgent Driver data source:
use strict; use DBI; my $dbh = DBI-> connect('dbi:ODBC:FreeAgent'); my $sth = $dbh->table_info() or die "Can't prepare statement: $DBI::errstr"; my @row; while (@row = $sth->fetchrow_array) { print join(", ", @row), "\n"; } $dbh->disconnect if ($dbh);
-
This script retrieves the names of the columns in these tables and views:
use strict; use DBI; my $dbh = DBI-> connect('dbi:ODBC:FreeAgent'); my $sth = $dbh->column_info('','','','') or die "Can't prepare statement: $DBI::errstr"; my @row; while (@row = $sth->fetchrow_array) { print join(", ", @row), "\n"; } $dbh->disconnect if ($dbh);
-
These scripts insert, update, and then delete some FreeAgent data:
use strict; use DBI; my $dbh = DBI-> connect('dbi:ODBC:FreeAgent'); my $sth = $dbh->prepare(q/INSERT INTO Bills (Contact, Reference, Dated_On, Due_On, Bill_Items) VALUES (?, ?, ?, ?, ?)/) or die "Can't prepare statement: $DBI::errstr"; $sth->execute('https://api.freeagent.com/v2/contacts/18727314', 'YEB021', '2025-01-16', '2025-01-16', '[{"category":"https://api.freeagent.com/v2/categories/291","description":"YEB-line-2-standing-charge","sales_tax_rate":"20","total_value_ex_tax":6.99}]'); $dbh->disconnect if ($dbh); use strict; use DBI; my $dbh = DBI-> connect('dbi:ODBC:FreeAgent'); my $sth = $dbh->prepare('UPDATE Bills SET Contact = \'Standing charges for second line.\' WHERE Id = ?') or die "Can't prepare statement: $DBI::errstr"; $sth->execute('31962267'); $dbh->disconnect if ($dbh); use strict; use DBI; my $dbh = DBI-> connect('dbi:ODBC:FreeAgent'); my $sth = $dbh->prepare('DELETE FROM Bills WHERE Id = ?') or die "Can't prepare statement: $DBI::errstr"; $sth->execute('31962267'); $dbh->disconnect if ($dbh);
Further information
PHP
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as PHP.
-
Check whether your PHP distribution supports ODBC. In
php.ini
, make sure there is no comment character (;
) before theextension_dir
andextension=odbc
settings (;extension_dir=directory
becomesextension_dir=directory
and;extension=odbc
becomesextension=odbc
). -
Create and then use PHP to run this script, which retrieves some FreeAgent data:
<?php // Replace FreeAgent with the name of your Easysoft ODBC-FreeAgent Driver data source. $con = odbc_connect("FreeAgent", "", ""); $stmt = odbc_exec($con, "SELECT * FROM Bills"); while ($row = odbc_fetch_array($stmt)) { echo "Contact = ", $row["Contact"], "\n"; } odbc_close($con); ?>
-
This script retrieves the tables and views in your Easysoft ODBC-FreeAgent Driver data source:
<?php $con = odbc_connect("FreeAgent", '', ''); $tables = odbc_tables($con); while (($row = odbc_fetch_array($tables))) { print_r($row); } odbc_close($con); ?>
-
This script retrieves the names of the columns in these tables and views:
<?php $con = odbc_connect('FreeAgent', '', ''); $columns = odbc_columns($con); while (($row = odbc_fetch_array($columns))) { print_r($row); } odbc_close($con); ?>
-
These scripts insert, update, and then delete some FreeAgent data:
<?php $cnx = odbc_connect("FreeAgent", "", ""); $stmt = odbc_prepare($cnx, "INSERT INTO Bills (Contact, Reference, Dated_On, Due_On, Bill_Items) VALUES (?, ?, ?, ?, ?)"); $success = odbc_execute($stmt, array('https://api.freeagent.com/v2/contacts/18727314', 'YEB021', '2025-01-16', '2025-01-16', '[{"category":"https://api.freeagent.com/v2/categories/291","description":"YEB-line-2-standing-charge","sales_tax_rate":"20","total_value_ex_tax":6.99}]')); odbc_close($cnx); ?> <?php $cnx = odbc_connect("FreeAgent", "", ""); $stmt = odbc_prepare($cnx, "UPDATE Bills SET Contact = 'Standing charges for second line.' WHERE Id = ?"); $success = odbc_execute($stmt, array('31962267')); odbc_close($cnx); ?> <?php $cnx = odbc_connect("FreeAgent", "", ""); $stmt = odbc_prepare($cnx, "DELETE FROM Bills WHERE Id = ?"); $success = odbc_execute($stmt, array('31962267')); odbc_close($cnx); ?>
Further information
Python
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as Python.
-
Check whether your Python distribution supports ODBC.
pip list
If you don’t have pip installed:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py
-
Do one of the following:
-
If the output contains
pyodbc
, your Python distribution supports ODBC. Skip to the next step. -
If the output does not contain
pyodbc
, use pip to install this module:pip install pyodbc
-
-
Create and then use Python to run this script, which retrieves some FreeAgent data:
import pyodbc # Replace FreeAgent with the name of your Easysoft ODBC-FreeAgent Driver data source. cnxn = pyodbc.connect("DSN=FreeAgent") cursor = cnxn.cursor() sql = "SELECT Contact FROM Bills" cursor.execute(sql) rows = cursor.fetchall() for row in rows: print(row.Contact) exit()
-
This script retrieves the tables and views in your Easysoft ODBC-FreeAgent Driver data source:
import pyodbc # Replace FreeAgent with the name of your Easysoft ODBC-FreeAgent Driver data source. cnxn = pyodbc.connect("DSN=FreeAgent") cursor = cnxn.cursor() cursor.tables() rows = cursor.fetchall() for row in rows: print(row.table_name) exit()
-
This script retrieves the names of the columns in these tables and views:
import pyodbc # Replace FreeAgent with the name of your Easysoft ODBC-FreeAgent Driver data source. cnxn = pyodbc.connect("DSN=FreeAgent") cursor = cnxn.cursor() cursor.columns() rows = cursor.fetchall() for row in rows: print(row.table_name, row.column_name) exit()
-
These scripts insert, update, and then delete some FreeAgent data:
import pyodbc cnxn = pyodbc.connect("DSN=FreeAgent") cursor = cnxn.cursor() sql = "INSERT INTO Bills (Contact, Reference, Dated_On, Due_On, Bill_Items) VALUES (?, ?, ?, ?, ?)" cursor.execute(sql, 'https://api.freeagent.com/v2/contacts/18727314', 'YEB021', '2025-01-16', '2025-01-16', '[{"category":"https://api.freeagent.com/v2/categories/291","description":"YEB-line-2-standing-charge","sales_tax_rate":"20","total_value_ex_tax":6.99}]') cursor.commit() exit()
import pyodbc cnxn = pyodbc.connect("DSN=FreeAgent") cursor = cnxn.cursor() sql = "UPDATE Bills SET Contact = Standing charges for second line.' WHERE Id = ?" cursor.execute(sql, '31962267') cursor.commit() exit()
import pyodbc cnxn = pyodbc.connect("DSN=FreeAgent") cursor = cnxn.cursor() sql = "DELETE FROM Bills WHERE Id = ?" cursor.execute(sql, '31962267') cursor.commit() exit()
Further information
R
-
Install the Easysoft ODBC-FreeAgent Driver on same computer as R.
-
In R Console, check whether your R distribution supports ODBC.
library("RODBC")
-
Do one of the following:
-
If you get no output, you have the ODBC library for R. Skip to the next step.
-
If you get an "there is no package" error, install the ODBC library for R:
install.packages("RODBC")
-
-
Create and then use R to run this script, which retrieves some FreeAgent data:
library("RODBC") # Replace FreeAgent with the name of your Easysoft ODBC-FreeAgent Driver data source. ch <- odbcConnect("FreeAgent") sqlQuery(ch, paste("SELECT Contact FROM Bills")) odbcClose(ch) quit()
-
This script retrieves the tables and views in your Easysoft ODBC-FreeAgent Driver data source:
library("RODBC") # Replace FreeAgent with the name of your Easysoft ODBC-FreeAgent Driver data source. ch <- odbcConnect("FreeAgent") sqlTables(ch) odbcClose(ch) quit()
-
This script retrieves the names of the columns in the specified table or view:
library("RODBC") # Replace FreeAgent with the name of your Easysoft ODBC-FreeAgent Driver data source. ch <- odbcConnect("FreeAgent") sqlColumns(ch, sqtable="Bills") odbcClose(ch) quit()
-
These scripts insert, update, and then delete some FreeAgent data:
library("RODBC") ch <- odbcConnect("FreeAgent") sqlQuery(ch, paste("INSERT INTO Bills (Contact, Reference, Dated_On, Due_On, Bill_Items) VALUES ('https://api.freeagent.com/v2/contacts/18727314', 'YEB021', '2025-01-16', '2025-01-16', '[{"category":"https://api.freeagent.com/v2/categories/291","description":"YEB-line-2-standing-charge","sales_tax_rate":"20","total_value_ex_tax":6.99}]')")) odbcClose(ch) quit() library("RODBC") ch <- odbcConnect("FreeAgent") sqlQuery(ch, paste("UPDATE Bills SET Contact = 'Standing charges for second line.' WHERE Id = '31962267'")) odbcClose(ch) quit() library("RODBC") ch <- odbcConnect("FreeAgent") sqlQuery(ch, paste("DELETE FROM Bills WHERE Id = '31962267'")) odbcClose(ch) quit()