On 6/14/06, Steve Ellenoff <[EMAIL PROTECTED]> wrote:
I was talking with a PHP programmer today and he asked me if you can connect 'directly' to MySQL or SQL Server like PHP does in a VFP program, or are you restricted to having to use ODBC.
You cannot connect "directly" to a database from PHP. You need to have a version of PHP with database-access libraries built into them. This is usually done, but there is not magic "USE MySQL" command in PHP.
First, I wasn't aware you could connect directly to MySQL or SQL Server, so how is the PHP language actually doing it?
Every database has a means of connection, an API to connect to it. Typically, there's a low-level API and a higher one with more abstract functionality.
Second, is there any way to connect from VFP without an ODBC connection?
Yes, but it would be a lot harder and more error-prone. You could use the MySQL client libraries and compile them in C to be an FLL. Why would you want to do this?
Third, if there is some form of 'direct' way to communicate to an MySQL or SQL Server database, why doesn't VFP support that method of communication?
Because it is harder. The point of ODBC (and the many similar initiatives in other languages) is to supply a fairly uniform set of functions like Connect(), Execute(), functions to pass data structure metadata and error information. So, what's you goal? Are you trying to avoid the burden of setting up ODBC on client workstations? If you're determined to continue coding in VFP, I don't think there are a lot of good options. -- Ted Roche Ted Roche & Associates, LLC http://www.tedroche.com _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

