Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Odbc and vfp 9
Message
De
28/09/2006 12:45:07
 
 
À
28/09/2006 12:17:52
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01157769
Message ID:
01157903
Vues:
29
This message has been marked as the solution to the initial question of the thread.
>>>>Hello All,
>>>>
>>>>I need to use ODBC on a VFP 9 database. This ODBC connection should be used from a PHP script.
>>>>
>>>>I have installed VFP 9 with SP1 (all ODBC drivers installed).
>>>>
>>>>However, I cannot create any DSN because ODBC claims that there is no Visual FoxPro ODBC driver installed.
>>>>
>>>>I insist that I need to do this with and ODBC connection (no ADO permitted).
>>>>
>>>>Can someone give me a hand on this?
>>>>
>>>>Pat
>>>
>>>Hi Pat,
>>>How are you doing:) No one can give you a hand on that anymore:( VFPOLEDB is the way to go.
>>>You might install latest ODBC driver downloading from MS site (included with MDAC 2.5) if you don't need to access VFP9 specific databases.
>>>Cetin
>>
>>Hello Cetin,
>>
>>It's been quite a long time now! I haven't been touching VFP for a while : very busy with C projects and Web projects (involving PHP).
>>
>>Here's what I need to do: from a PHP script, I need to interact with VFP 9 data files. The client said that it needs to be working with ODBC and not with ADO (I don't know why).
>>
>>But whatever way I am using, it seems that I am always blocked somewhere along the road.
>>
>>Should you use ASP .NET, Cetin, how would you interact with VFP databases then (If I see how it works with ASP .NET, I will be able to extrapolate it to PHP)? Even If I need to use VFPOLEDB ...
>>
>>Pat
>
>Pat,
>Didn't explicitly check each one. Also there were few lately on forums.msdn.com.
>
>Re: Connecting to VFP Data in ASP.NET Thread #1072118 Message #1082955
>Re: C# BDF manipulation? Thread #1077139 Message #1077507
>Re: Using OleDbParameters and FOXPRO MEMO Fields Thread #1026872 Message #1026953
>Re: Easy in VFP !!! Thread #1032196 Message #1032287
>
>Cetin

Hello Cetin,

The first link if of great help. The others didn't bring much help ... BUT ... here we go Cetin ... based on what I just read I came up with the following code that works fine:
<?php   $hConn = new COM("ADODB.Connection");
        $hConn->Open( "Provider=VFPOLEDB;Data Source=C:\manage2100\Sentanai\Data\;Collating Sequence=Machine" );

        $rs = $hConn->Execute( "SELECT * FROM projects" );

        while ( ! $rs->EOF )
        {
            echo $rs->fields[0] . " -- " . $rs->fields[1] . "<br />\n";
            $rs->MoveNext();
        }

?>
This code works perfectly on VFP 9 tables. Now it's a question of knowing more about the objects, methods, properties of ADO.

Thanks Cetin ... your intervention was really worth it!

Pat
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform