Re: VC++ ADO VFPOLEDB: DB locally works; DB on NT server does not by JimWalsh
JimWalsh
Tue Apr 04 14:31:02 CDT 2006
Hi Cindy,
I double-checked permissions, and can not see anything amiss.
I have begun testing this problem with Excel's Data Import using Microsoft's
OLE DB Provider for Visual FoxPro. In this way, I let it build the connection
string, and allows me to distinguish between my program and the components
connecting to the database (ADO and VFPOLEBB).
Here is more information about my testing.
As I mentioned in my original post, I am able to work with the database as
it is stored on my own computer, but not with the copy of the database that
is stored on our network server, a Win NT 4 SP6 system.
I am in the process of setting up a new server, based on Win2K3. So, I
copied my copy of the database to a folder there. That worked just fine both
with Excel, and my application. I then deleted the contents of the database
folder on the Win2K3 machine, and copied the database from the Win NT machine
into the same folder on the Win2K3 folder. Now, access to the database (on
the Win2K3 machine) worked with both Excel and my program.
At the present time, the connection string to the database is hard-coded in
my program. I will make this more user-friendly when I get the bugs worked
out. But, a simple way to add some flexibility was to change the connection
string to use a mapped drive letter instead of the actual path, i.e.
T:\MyDatabase.dbc. Then, I could change the database being used by changing
the mapping without changing my program.
But, this didn't work either with my program, nor with Excel. My program
give the same error message as before: "Feature is not available". Excel's
Test Connection button succeeds, but it is unable to list the tables in the
database.
So, I backed up, and restored the original connection string, i.e.
\\GSCSERVER\DBFolder\MyDatabase.dbc. This no longer worked in my program, nor
Excel.
Seems like something is happening to the database to prevent working with it
using VFPOLEDB. However, it continues to be accessible to me using the Visual
FoxPro Development system.
Two questions:
1. Any idea of what is going on here?
2. Are there any tools available for getting more information about what is
going on? For example, like ODBC tracing. Or, is there a debug version of
VFPOLEDB. The error message is coming from someplace, but where? And, what
does it mean?
Thanks again,
Jim
"Cindy Winegarden" wrote:
> Hi Jim,
>
> As you've realized, you've got a permissions issue. ADO seems to be using a
> different user than you when you access the data. Have you tried specifying
> a password in the connection string? Is there anything in your AppConfig
> file that might influence security permissions?
>
> --
> Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
> cindy_winegarden@msn.com www.cindywinegarden.com
>
>
> "Jim Walsh" <JimWalsh@discussions.microsoft.com> wrote in message
> news:E10FEF14-C64A-41ED-A3FA-0087EB6F5E61@microsoft.com...
> > I've written an application in VC++ in VS2005 that includes access to a
> > VFP 9
> > database using ADO and the VFPOLEDB driver.
> >
> > I'm using ADO (msado15.dll).
> >
> > What is odd is that this application works fine when the VFP database is
> > on
> > my own computer, but when it is on the network server, and I attempt to
> > open
> > the RecordSet, I get an error saying "Feature is not available".
> >
> > To test this outside of my own program, I used Excel, Import External
> > Data,
> > and its Data Connection Wizard to create the connection to my database on
> > the
> > server. When I click Test Connection, I get a message saying connection
> > succeeded. I then select Access permissions Read and Share Deny None. The
> > window that would allow me to select the table to use is empty.
> >
> > If I repeat this using the VFP database on my own computer, the window
> > lists
> > all of the tables in the database.
> >
> > The database on my computer is a copy of the one on the network server.
> >
> > I am logged into the network using an administrative account.
> >
> > I can use VFP, and open the database on the server from my computer
> > without
> > a problem.
> >
> > I would appreciate your help.
> >
> > Thanks,
> >
>
>
>