Author Topic: Script BASIC Features - ODBC  (Read 1017 times)

0 Members and 1 Guest are viewing this topic.

Root

  • Administrator
  • *****
  • Posts: 6
Script BASIC Features - ODBC
« on: May 03, 2017, 02:11:23 pm »
This is an example of using the Script BASIC ODBC extension module accessing Sage 100 AR_Customer ODBC table reference.

Code: Script BASIC
  1. ' Sage 100 Customers - ABC Demo
  2.  
  3. IMPORT odbc.sbi
  4.  
  5. dbh = odbc::RealConnect("SOTAMAS90","","")
  6. odbc::query(dbh,"SELECT * FROM AR_Customer")
  7.  
  8. WHILE odbc::FetchHash(dbh, column)
  9.   PRINT column{"CustomerNo"}," - ",column{"CustomerName"}," - ",column{"TelephoneNo"},"\n"
  10. WEND
  11.  
  12. odbc::Close(dbh)
  13.  


C:\ScriptBASIC\examples\test>scriba cust90.sb
ABF - American Business Futures - (414) 555-4787
ABS - ABS - Sage cloud for invoices - (949) 555-7814
AVNET - Avnet Processing Corp - (414) 555-2635
BRESLIN - Breslin Parts Supply - (414) 555-9654
HILLSB - Hillsboro Service Center - (414) 555-6599
INACTIV - Inactive Customer **INACTIVE** - (414) 555--8747
MAVRK - Maverick Papers - (312) 861-1200
RSSUPPL - R & S Supply Corp. - (414) 555-5587
SHEPARD - Shepard Motorworks - (414) 555-6544
ALLENAP - Allen's Appliance Repair - (714) 555-3121
AMERCON - American Concrete Service - (714) 555-2134
ATOZ - A To Z Carpet Supply - (714) 555-2231
AUTOCR - Autocraft Accessories - (714) 555-0101
BAYPYRO - Bay Pyrotronics Corp. - (415) 555-9654
CAPRI - Capri Sailing Ships - (714) 555-4421
CUSTOM - Custom Craft Products - (714) 555-7848
GREALAR - Greater Alarm Company - (714) 555-5531
JELLCO - Jellco Packing - (714) 555-9451
ORANGE - Orange Door & Window Co. - (714) 555-7823

C:\ScriptBASIC\examples\test>