troubleshooting Question

How can I retrieve the queries of a Visual FoxPro database?

Avatar of ASD-JO
ASD-JO asked on
System Programming
7 Comments1 Solution201 ViewsLast Modified:
Hello experts,

I am using the MFC OLE DB to connect to a Visual FoxPro database, and I am trying to retrieve the queries names of that database, but it didn’t work. Here below the code I used:


     CoInitialize(NULL);
 
     CDataSource dsDataSource;
     HRESULT hr = dsDataSource.Open();

     if(!hr)
     {
          CSession stnSession;
          hr = stnSession.Open(dsDataSource);

          if(!hr)
          {
               CProcedures proc;
               HRESULT hr = proc.Open(stnSession);

               if(!hr)
               {
                    hr = proc.MoveFirst();
 
                    while(!hr)
                    {          
                         MessageBox(proc.m_szName);
                         hr = proc.MoveNext();  
                    }
               }
           }
      }


Does anyone know if the previous code fragment has any problem, or if there is any other way to retrieve the queries names of a Visual FoxPro database?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros