I want to test some functions out on the server in the interactive window. However, the PathAlias.ADB_Path does not get resolved when interactively executing just the functions. However the path does get resolved while locally interactively testing the functions.
Interactive testing on the server, I have to use the fully qualified path instead.
The PathAlias.ADB_Path gets resolve while running .a5w pages with grids and dialog boxes.
This leads me to believe that I cannot test the functions out on the server using PathAlias.ADB_Path.
The code is shown below.
Two parameters: (User and flg)
Enter Users Last Name and the function will return the user's first name.
Setting flag = 0 opens the table using [PathAlias.ADB_Path]
Setting flag = 1 will call another function passing to it PathAlias.ADB_Path
Setting flag = 2 will call the same function as in flag = 1 above, but the function sets the fully qualified path instead of using an alias.
Locally, all three cases finds the table and successfully opens it.
Out on the server only setting flg = 2 does it succeed.
Interactive testing on the server, I have to use the fully qualified path instead.
The PathAlias.ADB_Path gets resolve while running .a5w pages with grids and dialog boxes.
This leads me to believe that I cannot test the functions out on the server using PathAlias.ADB_Path.
The code is shown below.
Two parameters: (User and flg)
Enter Users Last Name and the function will return the user's first name.
Setting flag = 0 opens the table using [PathAlias.ADB_Path]
Setting flag = 1 will call another function passing to it PathAlias.ADB_Path
Setting flag = 2 will call the same function as in flag = 1 above, but the function sets the fully qualified path instead of using an alias.
Locally, all three cases finds the table and successfully opens it.
Out on the server only setting flg = 2 does it succeed.
Code:
' Given user's last name, return user's first name. FUNCTION getFirstName AS C (user as C,flg as N) dim T as P dim N as N dim tName as C 'debug(1) getFirstName = "" if flg = 0 then 'Open table directly resolving the PathAlias.ADB_Path here as shown in documents. T = table.open("[PathAlias.ADB_Path]\people.dbf") elseif flg = 1 then 'call the TableName function and pass the path alias to the function for it to resolve. tName = TableName("people.dbf","[PathAlias.ADB_Path]") T = table.open(tName) elseif flg = 2 then 'Call the TableName function without the additional parameter. In this case the path 'is fully qualified, so it does not use the path alias. tName = TableName("people.dbf") T = table.open(tName) end if T.index_primary_put("Lastname") N = T.fetch_find(user) if N > 0 then getFirstName = T.Firstname end if T.close() 'debug(0) END FUNCTION FUNCTION TableName AS C (name as C, path = "") If path = "" then TableName = "C:\a5v9\data\\" + name else TableName = path+"\\" + name end if END FUNCTION