Re: [PHP] PHP and FoxPro

2009-07-21 Thread Floyd Resler

Matt,
	Thanks for the information.  I'll look into using ODBTP.  I noticed  
you mentioned the problem with memos.  I currently have that problem  
with the set up we're using and it is a pain!


Thanks!
Floyd

On Jul 20, 2009, at 3:22 PM, Matt Neimeyer wrote:

We currently use the Easysoft ODBC Bridge to connect to a remote  
FoxPro
database.  The problem is that the bridge, after a while, starts  
consuming a
ton of system resources and we have to reboot the machine.   
Afterwards, it
can take upwards to two hours before everything is running quickly  
again.
We need another solution.  Does anyone know of a any other way to  
connect

to a remote FoxPro database (or any ODBC source that isn't a database
server)?


We've had a LOT a luck using ODBTP. Which can be found at
http://odbtp.sourceforge.net

Here's the rough outline...

1. Install Visual FoxPro odbc driver (or whatever drivers you want) on
a Windows machine.
2. Install the ODBTP Server on the windows machine
3. Install a PHP module in your php. (Common ones included in the  
download)

4. Once you connect the functions are ALMOST exactly the same in usage
as the mysql_xyz functions.

A couple gotchas:

1. If you need to compile the PHP ODBTP module from source on x64 (OS
X Leopard at least) it can be a pain.
2. The VFP 6.0 ODBC driver (not sure about higher versions) does not
allow more than 250 odd characters to be inserted at a single time so
memo's can be a PAIN.
3. It does require a port be opened on the Windows machine's
firewall... (Uses TCP/IP for communication)
4. By default the ODBTP server can use up to 32 threads. The VFP ODBC
driver is by nature single threaded. We've never had a problem with
that directly but I assume it is what causes threads to slowly hang
and disappear... eventually a message comes up Unable to create
thread. At that point you simply need to restart the ODBTP service in
the Windows Services Control Panel. The bigger the tables and the more
heavily used it is the more often this will happen.

Other than that... Works like a charm. Looking forward, once you bite
the bullet and convert to MySQL (at least for us) you can almost
change odbtp_ to mysql_ and be up and running. (Assuming you limit
yourself to pure SQL and not invoke VFP functions.)

Matt




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and FoxPro

2009-07-21 Thread Matt Neimeyer
What I did to handle memos... and it's a HACK... was to create a
function DoMemo that took as arguments the table, the primary key
field of the table, the value of said pk, the field to update, and the
string.

Take the first 200 characters of the string.
Replace all newlines in that substring with +CHR(13)+ (Or CHR(13)+CHR(10)?)
Then do something like: UPDATE table SET field=First200 WHERE pk=pkvalue

Then take the next 200 characters of the string.
Replace all newlines as above
Do something like: UPDATE table SET field=ALLTRIM(field)+Next200 WHERE
pk=pkvalue

Repeat until you've consumed the entire string. This works because
you never put in more that 250 odd characters at a time. It can still
fail though if you have enough newlines to push your 200 characters up
over the 250 odd character limit.

It DOES work if you use RECNO() as the pk field and the appropriate
recno() that you would get if you did something like SELECT recno() AS
myrecno,* FROM sometable (I use the myrecno because otherwise you get
some weird exp_1 field name)

It just popped into my head... I wonder if something like this would work...

UPDATE sometable SET a=1,a=a+1,a=a+1,a=a+1 WHERE x=y

You might be able to limit the total number of calls to the database
that way... If I wasn't in the process of migrating to MySQL I might
give it a whirl... :)

Hope this helps whatever you decide to do.

On Tue, Jul 21, 2009 at 8:27 AM, Floyd Reslerfres...@adex-intl.com wrote:
 Matt,
        Thanks for the information.  I'll look into using ODBTP.  I noticed
 you mentioned the problem with memos.  I currently have that problem with
 the set up we're using and it is a pain!

 Thanks!
 Floyd

 On Jul 20, 2009, at 3:22 PM, Matt Neimeyer wrote:

 We currently use the Easysoft ODBC Bridge to connect to a remote FoxPro
 database.  The problem is that the bridge, after a while, starts
 consuming a
 ton of system resources and we have to reboot the machine.  Afterwards,
 it
 can take upwards to two hours before everything is running quickly again.
 We need another solution.  Does anyone know of a any other way to connect
 to a remote FoxPro database (or any ODBC source that isn't a database
 server)?

 We've had a LOT a luck using ODBTP. Which can be found at
 http://odbtp.sourceforge.net

 Here's the rough outline...

 1. Install Visual FoxPro odbc driver (or whatever drivers you want) on
 a Windows machine.
 2. Install the ODBTP Server on the windows machine
 3. Install a PHP module in your php. (Common ones included in the
 download)
 4. Once you connect the functions are ALMOST exactly the same in usage
 as the mysql_xyz functions.

 A couple gotchas:

 1. If you need to compile the PHP ODBTP module from source on x64 (OS
 X Leopard at least) it can be a pain.
 2. The VFP 6.0 ODBC driver (not sure about higher versions) does not
 allow more than 250 odd characters to be inserted at a single time so
 memo's can be a PAIN.
 3. It does require a port be opened on the Windows machine's
 firewall... (Uses TCP/IP for communication)
 4. By default the ODBTP server can use up to 32 threads. The VFP ODBC
 driver is by nature single threaded. We've never had a problem with
 that directly but I assume it is what causes threads to slowly hang
 and disappear... eventually a message comes up Unable to create
 thread. At that point you simply need to restart the ODBTP service in
 the Windows Services Control Panel. The bigger the tables and the more
 heavily used it is the more often this will happen.

 Other than that... Works like a charm. Looking forward, once you bite
 the bullet and convert to MySQL (at least for us) you can almost
 change odbtp_ to mysql_ and be up and running. (Assuming you limit
 yourself to pure SQL and not invoke VFP functions.)

 Matt




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and FoxPro

2009-07-21 Thread Floyd Resler

Matt,
	Thanks for the tip on handling memos.  I always thought, If I could  
just append to the end of the existing string... but never figured  
out how to do it.  I'll give your method a shot.


Thanks!
Floyd

On Jul 21, 2009, at 2:04 PM, Matt Neimeyer wrote:


What I did to handle memos... and it's a HACK... was to create a
function DoMemo that took as arguments the table, the primary key
field of the table, the value of said pk, the field to update, and the
string.

Take the first 200 characters of the string.
Replace all newlines in that substring with +CHR(13)+ (Or  
CHR(13)+CHR(10)?)
Then do something like: UPDATE table SET field=First200 WHERE  
pk=pkvalue


Then take the next 200 characters of the string.
Replace all newlines as above
Do something like: UPDATE table SET field=ALLTRIM(field)+Next200 WHERE
pk=pkvalue

Repeat until you've consumed the entire string. This works because
you never put in more that 250 odd characters at a time. It can still
fail though if you have enough newlines to push your 200 characters up
over the 250 odd character limit.

It DOES work if you use RECNO() as the pk field and the appropriate
recno() that you would get if you did something like SELECT recno() AS
myrecno,* FROM sometable (I use the myrecno because otherwise you get
some weird exp_1 field name)

It just popped into my head... I wonder if something like this would  
work...


UPDATE sometable SET a=1,a=a+1,a=a+1,a=a+1 WHERE x=y

You might be able to limit the total number of calls to the database
that way... If I wasn't in the process of migrating to MySQL I might
give it a whirl... :)

Hope this helps whatever you decide to do.

On Tue, Jul 21, 2009 at 8:27 AM, Floyd Reslerfres...@adex-intl.com  
wrote:

Matt,
   Thanks for the information.  I'll look into using ODBTP.  I  
noticed
you mentioned the problem with memos.  I currently have that  
problem with

the set up we're using and it is a pain!

Thanks!
Floyd

On Jul 20, 2009, at 3:22 PM, Matt Neimeyer wrote:

We currently use the Easysoft ODBC Bridge to connect to a remote  
FoxPro

database.  The problem is that the bridge, after a while, starts
consuming a
ton of system resources and we have to reboot the machine.   
Afterwards,

it
can take upwards to two hours before everything is running  
quickly again.
We need another solution.  Does anyone know of a any other way to  
connect
to a remote FoxPro database (or any ODBC source that isn't a  
database

server)?


We've had a LOT a luck using ODBTP. Which can be found at
http://odbtp.sourceforge.net

Here's the rough outline...

1. Install Visual FoxPro odbc driver (or whatever drivers you  
want) on

a Windows machine.
2. Install the ODBTP Server on the windows machine
3. Install a PHP module in your php. (Common ones included in the
download)
4. Once you connect the functions are ALMOST exactly the same in  
usage

as the mysql_xyz functions.

A couple gotchas:

1. If you need to compile the PHP ODBTP module from source on x64  
(OS

X Leopard at least) it can be a pain.
2. The VFP 6.0 ODBC driver (not sure about higher versions) does not
allow more than 250 odd characters to be inserted at a single time  
so

memo's can be a PAIN.
3. It does require a port be opened on the Windows machine's
firewall... (Uses TCP/IP for communication)
4. By default the ODBTP server can use up to 32 threads. The VFP  
ODBC

driver is by nature single threaded. We've never had a problem with
that directly but I assume it is what causes threads to slowly hang
and disappear... eventually a message comes up Unable to create
thread. At that point you simply need to restart the ODBTP  
service in
the Windows Services Control Panel. The bigger the tables and the  
more

heavily used it is the more often this will happen.

Other than that... Works like a charm. Looking forward, once you  
bite

the bullet and convert to MySQL (at least for us) you can almost
change odbtp_ to mysql_ and be up and running. (Assuming you limit
yourself to pure SQL and not invoke VFP functions.)

Matt









--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and FoxPro

2009-07-20 Thread Floyd Resler

Paul,
	Believe me I would like nothing more that to get rid of FoxPro and  
convert it to MySQL.  Sadly, that's not possible right now. I'll check  
into dBase.


Thanks!
Floyd

On Jul 19, 2009, at 4:53 PM, Paul M Foster wrote:


On Sun, Jul 19, 2009 at 09:00:49AM -0400, Floyd Resler wrote:


We currently use the Easysoft ODBC Bridge to connect to a remote
FoxPro database.  The problem is that the bridge, after a while,
starts consuming a ton of system resources and we have to reboot the
machine.  Afterwards, it can take upwards to two hours before
everything is running quickly again.  We need another solution.  Does
anyone know of a any other way to connect to a remote FoxPro database
(or any ODBC source that isn't a database server)?


No way to convert the FoxPro to PostgreSQL or MySQL? FoxPro is ancient
and decrepit (I used to code in FoxPro).

There is a dBase module for PHP. I don't know if it handles generic
xBase files. I don't know much about the module, but you could check  
it

out.

Paul
--
Paul M. Foster

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and FoxPro

2009-07-20 Thread Matt Neimeyer
 We currently use the Easysoft ODBC Bridge to connect to a remote FoxPro
 database.  The problem is that the bridge, after a while, starts consuming a
 ton of system resources and we have to reboot the machine.  Afterwards, it
 can take upwards to two hours before everything is running quickly again.
  We need another solution.  Does anyone know of a any other way to connect
 to a remote FoxPro database (or any ODBC source that isn't a database
 server)?

We've had a LOT a luck using ODBTP. Which can be found at
http://odbtp.sourceforge.net

Here's the rough outline...

1. Install Visual FoxPro odbc driver (or whatever drivers you want) on
a Windows machine.
2. Install the ODBTP Server on the windows machine
3. Install a PHP module in your php. (Common ones included in the download)
4. Once you connect the functions are ALMOST exactly the same in usage
as the mysql_xyz functions.

A couple gotchas:

1. If you need to compile the PHP ODBTP module from source on x64 (OS
X Leopard at least) it can be a pain.
2. The VFP 6.0 ODBC driver (not sure about higher versions) does not
allow more than 250 odd characters to be inserted at a single time so
memo's can be a PAIN.
3. It does require a port be opened on the Windows machine's
firewall... (Uses TCP/IP for communication)
4. By default the ODBTP server can use up to 32 threads. The VFP ODBC
driver is by nature single threaded. We've never had a problem with
that directly but I assume it is what causes threads to slowly hang
and disappear... eventually a message comes up Unable to create
thread. At that point you simply need to restart the ODBTP service in
the Windows Services Control Panel. The bigger the tables and the more
heavily used it is the more often this will happen.

Other than that... Works like a charm. Looking forward, once you bite
the bullet and convert to MySQL (at least for us) you can almost
change odbtp_ to mysql_ and be up and running. (Assuming you limit
yourself to pure SQL and not invoke VFP functions.)

Matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP and FoxPro

2009-07-19 Thread Floyd Resler
We currently use the Easysoft ODBC Bridge to connect to a remote  
FoxPro database.  The problem is that the bridge, after a while,  
starts consuming a ton of system resources and we have to reboot the  
machine.  Afterwards, it can take upwards to two hours before  
everything is running quickly again.  We need another solution.  Does  
anyone know of a any other way to connect to a remote FoxPro database  
(or any ODBC source that isn't a database server)?


Thanks!
Floyd


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php