ALIAS not working

Moderator: Rathinagiri

Post Reply
User avatar
arturo_lopesoria
Posts: 23
Joined: Tue Sep 09, 2008 3:05 am
Location: Mexico

ALIAS not working

Post by arturo_lopesoria » Wed Sep 23, 2009 9:52 pm

I think is a bug:
I was probed it with V.2.9.3 & V2.9.4

Code: Select all


cFileGVA := GetFile( , "Archivo de Articulos" , "c:\" , .f., .f. ) 
if empty(cFileGVA)
   return .f.
endif

use (cFileGVA) alias ARTICS
if !used()
   msginfo("no se abrio;"+cFileGVA)
   return .f.
endif

select ARTICS  // AQUI MARCA ERROR ALIAS DOES NOT EXIST ARTICS

I was probed this way too:

Code: Select all

        dbUseArea( .T., "DBFCDX", cFileGVA, "ARTICS", lShared, lReadOnly )
EN ESTE ULTIMO CASO MARCA ERROR DE ARGUMENTO

User avatar
Roberto Lopez
HMG Founder
Posts: 3902
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 137 times

Post by Roberto Lopez » Thu Sep 24, 2009 12:35 am

arturo_lopesoria wrote:I think is a bug:
I was probed it with V.2.9.3 & V2.9.4

Code: Select all


cFileGVA := GetFile( , "Archivo de Articulos" , "c:\" , .f., .f. ) 
if empty(cFileGVA)
   return .f.
endif

use (cFileGVA) alias ARTICS
if !used()
   msginfo("no se abrio;"+cFileGVA)
   return .f.
endif

select ARTICS  // AQUI MARCA ERROR ALIAS DOES NOT EXIST ARTICS

I was probed this way too:

Code: Select all

        dbUseArea( .T., "DBFCDX", cFileGVA, "ARTICS", lShared, lReadOnly )
EN ESTE ULTIMO CASO MARCA ERROR DE ARGUMENTO
In the case that the problem be verified, it will be (eventually) a Harbour compiler bug.

MiniGUI library is not related with dbf handling at all.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
luisvasquezcl
Posts: 1040
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 12 times
Been thanked: 14 times
Contact:

Post by luisvasquezcl » Thu Sep 24, 2009 12:55 am

Hola Arturo:
¿verificaste si getfile() devuelve el archivo con el path completo?
otra cosa ... creo que el último parametro de la funcion dbusearea 'lreadonly' no se necesita ya que si abres la tabla y en el control donde la muestras los registros no permites que se edite, no podran hacer nada ;) .
saludos cordiales,
Luis Vasquez.

User avatar
mol
Posts: 2879
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 136 times
Been thanked: 76 times
Contact:

Post by mol » Thu Sep 24, 2009 6:46 pm

Try to insert

Code: Select all

MsgBox(cFileVGA) 
after instruction:

Code: Select all

GetFile...
You will see if cFileVGA contains whole path to database or only database filename....

User avatar
mol
Posts: 2879
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 136 times
Been thanked: 76 times
Contact:

Post by mol » Thu Sep 24, 2009 6:47 pm

I'm using aliases and they don't cause any error.
Always worked good

User avatar
arturo_lopesoria
Posts: 23
Joined: Tue Sep 09, 2008 3:05 am
Location: Mexico

Post by arturo_lopesoria » Thu Sep 24, 2009 8:06 pm

Excuse me
First I was thinking it was a harbour bug, but now Im sure there is an error on my code..
I put same code in a single program and ALIAS is working fine.. Sorry.

Thanks all of you for your ideas and support..
Saludos desde Mexico.
Arturo LS

Post Reply