Siebel VB Language Reference > Methods Reference for Siebel VB > Disk and Directory Control Methods >

Change Drive Method


The Change Drive method changes the default drive. It does not return a value. The drive that it changes to the default drive must exist and this drive must be in the range that the LASTDRIVE statement in the config.sys file specifies.

You can use a colon as part of the name of the drive but it is not required.

To change the current directory on a drive, you use the Change Directory method.

Format

ChDrive drive

The following table describes the arguments that you can use with this method.

Argument
Description

drive

A string expression that identifies the drive that this method makes the default drive. This method changes the drive according to one of the following values you provide in the drive argument:

  • Null string (""). The default drive remains the same.
  • A string. It uses the first letter only.
  • You do not include the drive argument. It displays an error message.
Example

The following example changes the default drive to A:

Sub Button_Click
   Dim newdrive as String
   newdrive = "A"
   If Left(CurDir,2)  <>  newdrive then
      ChDrive newdrive
   End If
End Sub

Siebel VB Language Reference Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices.