Using Newbie Database APIs


You can create Newbie Scripts that can save data directly to an ODBC Database. Using these

Newbie APIs, you can extract data from the web and save them to any ODBC compliant Database.

The first step is to setup an ODBC connection.

 

In the Windows Control Panel->Administrative Tools, run the program "Data Sources (ODBC)" and

create a new User Data Source:
 


 

Once your User Data Source has been created, you will see it listed as shown below:
 

 

For example here is a User Data Source called 'Paginas' referencing an Access database containing

a table called 'Companya' with the following fields:

RecID    AutoInc,
Name    Text,

Description    Text,

Location    Text,

URL    Memo,

Detailed Description    Memo,

Contact Info    Memo


Use the following Newbie Database APIs:

 

function OpenDBTable(sDataSourceName : string; sTableName: string): boolean;

function CloseDBTable: boolean;
function DBSetField(sFieldName: string; vData: Variant): boolean;
function DBGetField(sFieldName: string): Variant;
function AppendDBTable: boolean;
function EditDBTable: boolean;
function PostDBTable: boolean;

function EndOfDBTable: boolean;

function DBTableNext: boolean;

function DBTablePrior: boolean;

function DBTableFirst: boolean;

function DBTableLast: boolean;

 

 

The example below, opens the Database, appends a record and closes the Database:

 

OpenDBTable('Paginas', 'Companya');

AppendDBTable;

DBSetField('Name', 'ABC Trucking Company');

DBSetField('Description', 'Trucking Business');

DBSetField('URL', 'http://www.truckbiz.com'');

PostDBTable;

CloseDBTable;

 

 

Note: Newbie Database APIs are available in Newbie version 2.4e and higher

 


Newbie Web Automation