Difference between revisions of "DROP CONNECTION"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 1: Line 1:
=DROP CONNECTION=
 
 
 
 
==Class==
 
==Class==
 
Data Connectivity
 
Data Connectivity
Line 39: Line 36:
  
 
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

Revision as of 10:13, 29 April 2009

Class

Data Connectivity


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 Database Server, Recital Mirage Server, Recital Terminal Developer