Skip to content

[DBFVFP] Cannot use single-letter alias #2005

Description

@fforay

DbSelectArea() fails to properly re-select a work area opened under a single-letter alias — Alias() returns empty, DbGoTop() throws "Workarea not in use"

Opening a DBF under a work-area alias that is a single letter (e.g. "C") via DbUseArea(..., cAlias, ...) appears to succeed (Used(cAlias) returns .T.), but once another work area has been selected in between, re-selecting the original alias by name breaks: Alias() returns an empty string instead of the alias name, and a subsequent DbGoTop() throws a runtime error:

GenCodeText: Workarea not in use
SubCodeText: Current Workarea does not contain a table
FuncSym: DbGoTop

The identical sequence with a two-character alias ("CU") works correctly — Alias() returns "CU", DbGoTop() succeeds, and the field value reads back correctly.

Repro.prg.txt

Metadata

Metadata

Labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions