xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

RddSetDefault()

Retrieves or changes the default replaceable database driver.

Syntax

RddSetDefault( [<cNewRDD>] ) --> cOldRDD

Arguments

<cNewRDD>
This is a character string holding the name of the RDD to select as the new default RDD for opening files in a work area.

Return

The function returns a character string holding the name of the RDD selected as default RDD before the function is called. If <cNewRDD> is specified and an RDD of this name does not exist, a runtime error is raised.

Description

RddSetDefault() queries or changes the default replaceable database driver. The default RDD is used to open or create database and index files in a work area when the VIA clause of the USE command is omitted.

Note:  some RDDs, such as DBFCDX, for example, must be linked explicitly to an xHarbour application using the REQUEST statement.

Info

See also:RddInfo(), RddList(), RddName(), REQUEST
Category: Database drivers
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example REQUESTs the DBFCDX driver, opens a database
// with DBFNTX and then changes the default RDD.

   REQUEST DBFCDX

   PROCEDURE Main
      ? RddSetDefault()                // result: DBFNTX

      USE Customer ALIAS Cust

      ? RddSetDefault( "DBFCDX" )      // result: DBFNTX
      USE Orders   ALIAS Ord NEW

      ? RddSetDefault()                // result: DBFCDX

      ? RddMame()                      // result: DBFCDX
      ? Cust->( RddName() )            // result: DBFNTX
      ? Ord-> ( RddName() )            // result: DBFCDX

      CLOSE ALL
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe