Example of syntax for RemoteSQL function and with ascTAB constant:
- When using a Connection String
- When using a DSN
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 )