ExecuteOLEDB

Top  Previous  Next

×V2.1Ø

S

A

W

WS

ü

Syntax -

ExecuteOLEDB <Connection String> <Command> <ReplaceSingleQuotes>

       Where:

       <Connection String> is a literal string or a variable that contains a literal string.

       <Command> is a literal string or a variable that contains a literal string.

       <Replace Single Quotes> is a literal string or a variable that contains a string value of “Yes” or “No”

 

Description:

This command is used to execute the text provided in the <Command> against the OLEDB data source specified by the <Connection String>.  Frequently, this command will be an INSERT, UPDATE, or DELETE statement, although any syntax which is valid to the specified data source can be used.

The <Replace Single Quotes> parameter, if set to Yes will replace all occurrences of single quotes in the <Command> with double quotes.  This parameter will be necessary when your data source requires double quotes in the command because it is not possible to express double quotes inside a literal string in EMUE.   To use this option, you can use single quotes instead of double quotes, when building the <Command> and set the <Replace Single Quotes> parameter to “Yes”.

 

Note: The <Connection String> can be a direct reference to a data source, or it can utilize a DSN (Data Source Name) that is already installed on the EMUE PC.  A valid OLEDB connection string can be used to retrieve data from Microsoft Access, Excel, SQL Server, and most other commercial database formats.

If the command returns any type of result, it will be discarded, and not made available to the script.

 

Sample:

ExecuteOLEDB "Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\PTDB\PTDB.MDB;" "UPDATE [PatientList] SET [Last Name] = JONES WHERE PT_ID = 2;" “Yes”