Article ID: 10210
HOWTO:  RemoteSQL function and use with TAB delimiter, examples
HOWTO
Applies To: ITScriptNet V3

Example of syntax for RemoteSQL function and with ascTAB constant:

  • When using a Connection String
  • When using a DSN
DETAILS

When using a Connection String to Access:

Ex1:  Before Prompting
@DSN@ = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DatabaseName.mdb;Persist Security Info=False"

Ex2:  Button Click:
;Look Item Info Up on Server
@SQL@ = "SELECT tblItems.ItemUPC, tblItems.ItemDesc1, tblItems.ItemDesc2, tblItems.ItemPrice, tblItems.ItemWeight, tblItems.Qty FROM tblItems "
@SQL@ = @SQL@ & " WHERE tblItems.ItemUPC = '" & $PromptName.ElementName$ & "'"

@Data@ = RemoteSQL(@DSN@, @SQL@)

Message(@Data@,"","Ok","")

----------------------------------------------------------
When using a DSN:

@Ret@ = RemoteSQL( "DSN=DSNNameHere", "Select  item_id, net_weight  from  CARTONS  WHERE carton_number="  &  $promptname.tbBarcode$)

----------------------------------------------------------
When TAB delimited:

When two or more fields are returned, the data is returned in tab-delimited format.  The delimiter to use is the ITScriptNet ascTAB constant.  The constants list can be found in the upper-left pane of the program designer's script window under 'Constants'. 

Ex:

Use the ITScriptNet Constact ascTAB:
@returnItemid@ = SplitN(@Ret@, ascTAB, 1 )
@returnWeight@ = SplitN(@Ret@, ascTAB, 2 )



 

This article last updated: 7/11/2009 11:39:37 AM
Please help us improve the Knowledge Base by rating this article.
    © 1997-2026 Z-Space Technologies - a BCA Innovations Company - All rights reserved