Difference between revisions of "DROP CONNECTION"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=DROP CONNECTION=
 
 
 
==Class==
 
Data Connectivity
 
 
 
 
==Purpose==
 
==Purpose==
 
Delete a gateway connection file
 
Delete a gateway connection file
Line 39: Line 32:
  
 
CREATE CONNECTION conn1 DATASOURCE "server1" USERID "user1";
 
CREATE CONNECTION conn1 DATASOURCE "server1" USERID "user1";
PASSWORD "pass1" DATABASE "/usr/recital/data/demo"
+
  PASSWORD "pass1" DATABASE "/usr/recital/data/demo"
 
nStatHand = SQLCONNECT("conn1.gtw")
 
nStatHand = SQLCONNECT("conn1.gtw")
 
if nStatHand < 1
 
if nStatHand < 1
dialog box [Could not connect]
+
    dialog box [Could not connect]
 
else
 
else
nTabEnd = SQLTABLES(nStatHand)
+
    nTabEnd = SQLTABLES(nStatHand)
if nTabEnd = 1
+
    if nTabEnd = 1
select sqlresult
+
        select sqlresult
browse
+
        browse
endif
+
    endif
SQLDISCONNECT(nStatHand)
+
    SQLDISCONNECT(nStatHand)
 
endif
 
endif
 
DROP CONNECTION conn1
 
DROP CONNECTION conn1
Line 56: Line 49:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:SQL]]
 
[[Category:SQL]]
 
[[Category:Commands]]
 
[[Category:Commands]]

Latest revision as of 17:04, 10 November 2009

Purpose

Delete a gateway connection file


Syntax

DROP CONNECTION <filename>


See Also

CREATE CONNECTION, REMOTE DATA CONNECTIVITY FUNCTIONS


Description

The DROP CONNECTION command is used to delete a gateway connection file to an external SQL database. Connection files are created by the CREATE CONNECTION command and can be used by the SQLCONNECT() and SQLSTRINGCONNECT() remote data connectivity functions to establish a connection for SQL access to a database.


Keywords Description
filename The name of the gateway connection. If no file extension is specified, then .gtw is used.


Example

// config.db
set sql to vfp
set sql on
// end of config.db
 
CREATE CONNECTION conn1 DATASOURCE "server1" USERID "user1";
  PASSWORD "pass1" DATABASE "/usr/recital/data/demo"
nStatHand = SQLCONNECT("conn1.gtw")
if nStatHand < 1
    dialog box [Could not connect]
else
    nTabEnd = SQLTABLES(nStatHand)
    if nTabEnd = 1
        select sqlresult
        browse
    endif
    SQLDISCONNECT(nStatHand)
endif
DROP CONNECTION conn1


Products

Recital Server, Recital