Home > Archive > Programming with dBASE > February 2006 > Trying to get data from foxpro table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Trying to get data from foxpro table
Martin Lambert

2006-02-25, 9:36 am

Sorry, I lost my previous post.

Roland gave me the solution to be able to read foxpro table with ODBC
connection. That work fine.

But now, I want to get data from those tables and can't figure how.

I open the database, I see the tables. I made a small PRG that read data
from one table and I have a replace command with an append blank. I receive
an error that microsoft ODBC does not accept null value.

Also, if I want to activate an index, I receive the error that tbale is not
indexed. I can't create an index as the table open in readonly mode.

What am'I doing wrong ?


Eric Logan

2006-02-25, 9:36 am

> "Martin Lambert" wrote ...
> Roland gave me the solution to be able to read foxpro table with ODBC
> connection. That work fine.
> But now, I want to get data from those tables and can't figure how.
> I open the database, I see the tables. I made a small PRG that read data
> from one table and I have a replace command with an append blank. I

receive
> an error that microsoft ODBC does not accept null value.
> Also, if I want to activate an index, I receive the error that tbale is

not
> indexed. I can't create an index as the table open in readonly mode.
> What am'I doing wrong ?


Martin;
You could try using Updateset. You will need compatibility between source
and destination tables: field names and order, field definitions, etc.
E.L.
Example:
***
// Append data from table in ODBC database
// into local table
// open ODBC Database
d = new database()
d.databasename = 'ODBCDATABASE'
d.active = true
//open table in ODBC database
q = new query()
q.database = d
q.sql = [select * from 'DatabaseTable']
q.active = true
// Open local dbase table with query
q1 = new query()
q1.sql = 'select * from LocalTable.dbf'
q1.active = true
// Append ODBC data into LOcal table
u = new updateset()
u.source = q.rowset
u.destination = q1.rowset
u.append()
q1.rowset.save()
// close databases and queries
q.active = false
q1.active = false
d.active = false
release object d
release object q
release object q1
****


Martin Lambert

2006-02-28, 8:25 pm

Ok playing with your solution, I managed to get the data except what is in
the MEMO field.
Is there a way to convert a DBT file to FPT ?

"Eric Logan" <jelogan@pcweb.net> a écrit dans le message de news:
XWhOQWXOGHA.592@news-server...
> receive
> not
>
> Martin;
> You could try using Updateset. You will need compatibility between source
> and destination tables: field names and order, field definitions, etc.
> E.L.
> Example:
> ***
> // Append data from table in ODBC database
> // into local table
> // open ODBC Database
> d = new database()
> d.databasename = 'ODBCDATABASE'
> d.active = true
> //open table in ODBC database
> q = new query()
> q.database = d
> q.sql = [select * from 'DatabaseTable']
> q.active = true
> // Open local dbase table with query
> q1 = new query()
> q1.sql = 'select * from LocalTable.dbf'
> q1.active = true
> // Append ODBC data into LOcal table
> u = new updateset()
> u.source = q.rowset
> u.destination = q1.rowset
> u.append()
> q1.rowset.save()
> // close databases and queries
> q.active = false
> q1.active = false
> d.active = false
> release object d
> release object q
> release object q1
> ****
>
>



Eric Logan

2006-02-28, 8:25 pm

Martin:
Memos seem to be the unsolved problem with foxpro tables. Some time back
there was a suggestion to use Advantage ODBC drivers to open foxpro tables.
Maybe that would help with the memo fields. I haven't tried it.
Eric

< "Martin Lambert" wrote ...
> Ok playing with your solution, I managed to get the data except what is in
> the MEMO field.
> Is there a way to convert a DBT file to FPT ?




Eric Logan

2006-02-28, 8:25 pm

Maybe the Advantage ODBC is the solution for reading FoxPro memos:
http://www.extendedsystems.com/web/...
DAB01237

F158E46B
"What file formats are supported by the Advantage ODBC Driver?"
..........
"The two Xbase file formats that Advantage supports are
CA-Clipper-compatible file types and FoxPro-compatible file types. The
CA-Clipper-compatible file format consists of .DBF tables, .NTX index files,
and .DBT memo files. The FoxPro-compatible file format consists of .DBF
tables, .CDX and .IDX index files, and .FPT memo files."


"Eric Logan" <jelogan@pcweb.net> wrote in message
news:0sCbdp8OGHA.592@news-server...
> Martin:
> Memos seem to be the unsolved problem with foxpro tables. Some time back
> there was a suggestion to use Advantage ODBC drivers to open foxpro

tables.
> Maybe that would help with the memo fields. I haven't tried it.
> Eric
>
> < "Martin Lambert" wrote ...
in[color=darkred]
>
>
>



Eric Logan

2006-02-28, 8:25 pm

After further investigation, it appears that the Advantage ODBC driver does
not by itself enable opening Foxpro tables. It is also necessary to have
installed either the Advantage Database Server or the Advantage Local
Server. So, quite a lot of software is required to get the benefit, if such
exists, of being able to open Visual Foxpro memo fields in dBase via the
Advantage ODBC driver.
E.L.


Martin Lambert

2006-02-28, 8:25 pm

I'll give it a try and let you know.
Thanks

"Eric Logan" <jelogan@pcweb.net> a écrit dans le message de news:
JhBtFl9OGHA.1148@news-server...
> Maybe the Advantage ODBC is the solution for reading FoxPro memos:
> http://www.extendedsystems.com/web/...
DAB01237

> F158E46B
> "What file formats are supported by the Advantage ODBC Driver?"
> .........
> "The two Xbase file formats that Advantage supports are
> CA-Clipper-compatible file types and FoxPro-compatible file types. The
> CA-Clipper-compatible file format consists of .DBF tables, .NTX index
> files,
> and .DBT memo files. The FoxPro-compatible file format consists of .DBF
> tables, .CDX and .IDX index files, and .FPT memo files."
>
>
> "Eric Logan" <jelogan@pcweb.net> wrote in message
> news:0sCbdp8OGHA.592@news-server...
> tables.
> in
>
>



Eric Logan

2006-02-28, 8:25 pm

I hope there is a convenient way. Maybe in two steps using Access and ODBC?
I have VisualFoxPro 6.0, so I simply make foxpro tables compatible with
dBase via the command "copy to <tablename> type fox2x".
E.L.
> "Martin Lambert" wrote ...
> I'll give it a try and let you know.
> Thanks




Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com