CPS to Oracle XE with DSN Connection

Description: setup Oracle XE table to receive data from barcode scanner connected to RS232 port COM1.

 
Start SQLPLUS and create new table:
 
SQL>
SQL> CREATE TABLE BARCODES_IN(
 2 BARCODE VARCHAR2(80) NOT NULL,
 3 COMPORT VARCHAR2(3) NOT NULL);
 
Table created.
 
 
 
Go to Control Panel > Administrative Tools > Data Sources (ODBC)
 
IMPORTANT NOTE: if you are on a 64-bit machine, __do not__ use the ODBC Window that is accessible from the control panel. Instead, go to START > RUN > C:\Windows\SysWOW64\odbcad32.exe.
 

 Select System DSN and click Add…

 

Select Oracle in XE and click Finish.

 Enter CPS2ORAXE for Datasource Name

Enter CPS2ORAXE for Data Source Name and select TNS Service Name (in this example XE)

Click on OK to confirm creation of new DSN.

New DSN - CPS2ORAXE
Close ODBC Data Source Administrator and start CPS Plus Professional> Terminal
 

Click on COM1 Settings…

 

 

 Image: CPS Plus COM port settings dialog

Check Send Serial data to Dabase using ODBC and click on Setup ODBC Connection

 

 select cps2oraxe

 

Enter username in UID field and Password in PWD data field.

   

oracle barcodes in table

 

Connection summary

 Acknowledge connection details and click on Finish to activate connection.

Scan for barcodes. Barcodes should be displayed in CPS Plus terminal window:

Scan for barcodes. Barcodes should be displayed in CPS Plus terminal window.

 

Check data in OracleXE. Switch to SQLPLUS and execute:
 
SQL> select * from barcodes_in;
 
BARCODE
------------------------------------------------------
 
COM
---
583969
1
 
4959112038073
1
 
4902030193508
1