FUNCITON LoadData as Integer ; HelpString [Loads the VFP Database] lcDatabase = "\\W2KDOMAIN\DONW2K\DATA\" IF DIRECTORY(m.lcDatabase) ; THEN OPEN DATABASE (m.lcDatabase+"mydb.dbc") ENDIF &&code omitted... ENDFUNC && LoadDataThis works perfectly fine the DLL is called from VFP command line and doesn't matter where the data is located (local or the server):
loObj = CreateObject("ClientAccess.CClientAccess")
loObj.LoadData() && Works
The DLL is added as a COM reference to my ASP.NET project. I've created a wrapper class which helps other classes the web app to communicate with the VFP MTDLL object. //Code omitted public class CClientAccessWrapper { private m_oVFPDB CClientAccess; public virtual void InitializeComponents() { this.m_oVFPDB = new CClientAccess(); this.m_oVFPDB.LoadData(); }//InitializeComponents }//CClientAccessWrapperAn unhandled exception occurs when LoadData method is called, I found out that the DIRECTORY is returning .f. in the LoadData if and only if the path is pointed to the W2K Server. In other words, if the database is located on the local machine it works. It seems to be some sort of Security Policy/User Rights issue.
"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."
- Ephesians 4:29-30 NIV
Dare to Question -- Care to Answer
Time is like water in a sponge, as long as you are willing you can always squeeze some.
--Lu Xun, Father of Modern Chinese Literature