Advertisement

07.30.2008 at 01:41PM PDT, ID: 23608944
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

OLEDB Connection to Visual Foxpro Database

Asked by street9009 in PHP for Windows, FoxPro Database

Tags: , ,

I am completely new to this area, so I hope I make sense when I finish typing this out. Anyway, here goes.

Essentially I am migrating websites from a Windows 2000 Standard Server to a Windows 2003 Standard Server. These websites use ODBC connections to connect to FoxPro databases that sit on another server (also Windows 2000 Standard Server). Most of the databases sit in a directory on a drive we've mapped to H:/. Any others we'd ever access are in the website directory itself (any side/extra tables we need to use go there).

To make a long story short, I've been on the phone with Microsoft about the ODBC not working. They have stopped supporting the FoxPro ODBC driver a long time ago and now recommend you use the OLEDB driver. But of course, with Microsoft, the only code you can get from them is written in VB or ASP or something they designed. No PHP support whatsoever.

I haven't been able to find much about how to actually connect to a FoxPro database, especially in the layout we have, with PHP and the OLEDB driver. I really need to be able to specify a directory the tables are in and have it open the one I choose. So I specify H:/pro/data20/ and then say "SELECT * FROM Customer" or whatever.

Is this doable with the OLEDB code? How exactly do I connect to these databases?

I'm going to attach a code snippiet that I've been trying, but it's just outputting an error right now:

Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft OLE DB Provider for Visual FoxPro<br/><b>Description:</b> Feature is not available.' in <file>:49 Stack trace: #0 <file>(49): com->Open('Provider=VFPOLE...') #1 <file>(83): CDB->Connect('H:\pro\data29', '', '', '') #2 <file>(92): CDB_Connect->ConnectIC() #3 <file>(84): CDBICItem_Cats->GetWhere(' WHERE (PLINID=...', ' ORDER BY CATEG...') #4 <file>(62): CDBICItem_Cats->GetCategories('Food & Beverage', '') #5 <file>(37): CDBICItem_Cats->GetCategory2and3('Food & Beverage') #6 {main} thrown in <file> on line 49

I know that probably won't mean much to you, but hopefully it can help give a clue as to where to head. I blanked out the file names and paths. Not really necessary, but I did it anyway.

I'd appreciate any guidance anyone can provide.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
// Connect to ODBC Data Source
function Connect($sDSN, $sDBName='', $sUID='', $sPWD='')
{
	$this->bIsNew = true;
	$this->DBLink = new COM("ADODB.Connection")  or die ("connection create fail");
	$this->DBLink->Provider = "vfpoledb.1"; // "MSDASQL";
	//$this->DBLink->Open("Provider=VFPOLEDB.1;Data Source={$sDSN};");
	$this->DBLink->Open("Provider=VFPOLEDB.1;Driver={Microsoft Visual FoxPro Driver}; SourceType=DBF; SourceDB=".$sDSN); 
	if ($this->DBLink) { return true; } else { return false; }
}
[+][-]07.30.2008 at 02:19PM PDT, ID: 22124901

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.30.2008 at 02:20PM PDT, ID: 22124909

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.30.2008 at 02:24PM PDT, ID: 22124947

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP for Windows, FoxPro Database
Tags: PHP/Microsoft Visual FoxPro 8/OLEDB, Any, N/A
Sign Up Now!
Solution Provided By: CarlWarner
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628