by JmGarcia » Wed Jun 06, 2007 8:12 pm
Yo tengo esta funcion que convierte nombres largos en cortos...
- Code: Select all Expand view RUN
function cShortName( cLong )
local cShort :=space(164)+Chr(0)
local nBuffer:=164
local nLen
nLen :=GetSPName(cLong,@cShort,nBuffer)
cShort:=left(cShort,nLen)
return cShort
DLL32 STATIC FUNCTION GetSPName(lpszLongPath AS STRING,;
lpszShortPath AS STRING,;
lBuffer AS LONG ) ;
AS LONG PASCAL FROM "GetShortPathNameA" LIB "kernel32"
Haz algo asi
dbUseArea(.T.,"",cShortName(cNombreLargo),"DBF"), en tu caso dbUseArea(.T.,"",cShortName("tb15050701.dbf"),"DBF")
Por si quieres te doy la funcion inversa:
- Code: Select all Expand view RUN
function cLongName(cShort)
local cLong:=space(164)+chr(0)
local nBuffer:=164
local nLen
nLen:=GetLPName(cShort,@cLong,nBuffer)
cLong:=left(cLong,nLen) && Quitar para Windows NT
return cLong
DLL32 STATIC FUNCTION GetLPName(lpszShortPath AS STRING,;
lpszLongPath AS STRING,;
lBuffer AS LONG) ;
AS LONG PASCAL FROM "GetLongPathNameA" LIB "kernel32"
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013