I'm writing a C++ tool that will list among other things, the stored
procedures in FoxPro dbc file. Is there an ODBC API for that? Has
anyone done that? SQLProcedures is not supported in FoxPro.

--Kobby

Re: SQLProcedures equivalent for FoxPro by Cindy

Cindy
Wed Mar 03 20:48:18 CST 2004

In news: 8f2fbb7f.0403031421.587a5091@posting.google.com,
Kobby <kbdapaah@yahoo.com> wrote:
> I'm writing a C++ tool that will list among other things, the stored
> procedures in FoxPro dbc file. Is there an ODBC API for that? Has
> anyone done that? SQLProcedures is not supported in FoxPro.

Hi Kobby,

The FoxPro DBC is a table, just like any other table, so you should be able
to connect to the DBC as a FoxPro free table. The stored procedure source
code is in a memo field - MyDbc.Code, where MyDbc.ParentID = 1 AND
MyDbc.ObjectType = "Database" AND MyDbc.ObjectName = "StoredProcedureSource"
.

You could parse out the contents of this field.

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org www.cindywinegarden.com




Re: SQLProcedures equivalent for FoxPro by kbdapaah

kbdapaah
Thu Mar 04 09:36:45 CST 2004

"Cindy Winegarden" <cindy.winegarden@mvps.org> wrote in message
> Hi Kobby,
>
> The FoxPro DBC is a table, just like any other table, so you should be able
> to connect to the DBC as a FoxPro free table. The stored procedure source
> code is in a memo field - MyDbc.Code, where MyDbc.ParentID = 1 AND
> MyDbc.ObjectType = "Database" AND MyDbc.ObjectName = "StoredProcedureSource"
> .
>
> You could parse out the contents of this field.

Let me make sure that I understand you. It is my understanding that a
DBC file is a collection of tables as opposed to DBF which can contain
only one table. Are you suggesting that I treat the DBC the same way
that I'll treat a DBF? What I'm trying to do is a generic (to some
extent) connector to ODBC DBs that's why I'll prefer an ODBC approach
rather than a FoxPro specific approach. I want the same portion of
code to work for SQL Server, even if it means using a switch
statement.

Thanks,
--Kobby

Re: SQLProcedures equivalent for FoxPro by Remus

Remus
Thu Mar 04 10:02:35 CST 2004

The ODBC recommended and compatible way is to use the driver catalog
functions (SQLTables, SQLColumns, SQLProcedures etc). Since you found that
the VFP driver does not support SQLProcedures, you must use a driver
specific approach. In the VFP driver case Cindy's recommendation works fine.

HTH,
Remus

"Kobby" <kbdapaah@yahoo.com> wrote in message
news:8f2fbb7f.0403040736.7738aa0c@posting.google.com...
> "Cindy Winegarden" <cindy.winegarden@mvps.org> wrote in message
> > Hi Kobby,
> >
> > The FoxPro DBC is a table, just like any other table, so you should be
able
> > to connect to the DBC as a FoxPro free table. The stored procedure
source
> > code is in a memo field - MyDbc.Code, where MyDbc.ParentID = 1 AND
> > MyDbc.ObjectType = "Database" AND MyDbc.ObjectName =
"StoredProcedureSource"
> > .
> >
> > You could parse out the contents of this field.
>
> Let me make sure that I understand you. It is my understanding that a
> DBC file is a collection of tables as opposed to DBF which can contain
> only one table. Are you suggesting that I treat the DBC the same way
> that I'll treat a DBF? What I'm trying to do is a generic (to some
> extent) connector to ODBC DBs that's why I'll prefer an ODBC approach
> rather than a FoxPro specific approach. I want the same portion of
> code to work for SQL Server, even if it means using a switch
> statement.
>
> Thanks,
> --Kobby



Re: SQLProcedures equivalent for FoxPro by swdev2

swdev2
Thu Mar 04 10:13:22 CST 2004

Hiya Kobby -
if in fact you wanted to retrieve things via ODBC -
you can't like you think.
You can with the OLE DB drivers, though.

OTOH
A database container is a meta repository of 'things' for VFP, and its
native file format IS a table.

You can open the databasecontainer as a table in ODBC, retrieve what you are
looking for,
and parse it out. [Cindy's suggestion]

In any event - I suggest you go the ole db route for sqlserver as well -
it's just more tightly coupled to the data store.

hth - mondo regards [Bill]
--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
Mondo Cool TeleCom -> http://www.efgroup.net/efgcog.html
Mondo Cool WebHosting -> http://www.efgroup.net/efglunar.html
Mondo Cool Satellites -> http://www.efgroup.net/sat
mySql / VFP / MS-SQL

"Kobby" <kbdapaah@yahoo.com> wrote in message
news:8f2fbb7f.0403031421.587a5091@posting.google.com...
> I'm writing a C++ tool that will list among other things, the stored
> procedures in FoxPro dbc file. Is there an ODBC API for that? Has
> anyone done that? SQLProcedures is not supported in FoxPro.
>
> --Kobby



Re: SQLProcedures equivalent for FoxPro by Cindy

Cindy
Thu Mar 04 12:39:28 CST 2004

In news: 8f2fbb7f.0403040736.7738aa0c@posting.google.com,
Kobby <kbdapaah@yahoo.com> wrote:
> "Cindy Winegarden" <cindy.winegarden@mvps.org> wrote in message
>> The FoxPro DBC is a table, just like any other table,
>
> Let me make sure that I understand you. It is my understanding that a
> DBC file is a collection of tables as opposed to DBF which can contain
> only one table.

No. The DBC is a table that contains information about all the other tables
that belong to it. It's a data dictionary, among other things.

FoxPro is a data driven development tool so the report structures (what the
Report Designer makes) are tables, the forms are tables, the class libraries
are tables, and the menus are tables (did I forget anything?) All of these
can be read just like they are tables, and opening these files in table mode
is a popular way to "hack" when there is a problem the designer can't
handle, or when you want to make massive changes like REPLACE ALL FontName
WITH "Arial" FOR FontName = "Courier".

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org www.cindywinegarden.com