Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Visual FoxPro needs .NET
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
FoxPro Dos
OS:
Windows '95
Network:
Novell 2.x
Database:
Jet/Access Engine
Divers
Thread ID:
01024102
Message ID:
01025365
Vues:
14
>Jordan,
>
>Something like this?:
>
>OleDbConnection oConn = new OleDbConnection();
>DataSet oDataSet = new DataSet();
>string connection = "Provider=vfpoledb.1;Data Source='u:\\pro30\\syuuser.dbf';password='';user id=''";
>oConn.ConnectionString = connection;
>OleDbDataAdapter oDA = new OleDbDataAdapter("Select * from syuuser",oConn);
>oConn.Open();
>oDA.Fill(oDataSet,"data");
>dataGrid1.SetDataBinding(oDataSet,"data");
>oConn.Close();
>
>Is this what you're looking for?

No. Here is real situation presented by my VB Team leader:

In our databases we use Identity fields for primary key columns. And AFAIK VFP OLEDB Provider doesn't offer a way to get generated identity value when you insert a row into such a table. You know, that this functionality is available in SQL Server, as well in Access 2000 and above. So we designed common data access architecture, which is database independent. But we cannot use it with DBFs because of lack of such a functionality.

I understand your way with simple numeric (not AutoInc) column, for which you can generate new values with custom function. But I think this approach has some disadvantages (beside impossibility to use it with our common data access architecture, which of course is only our problem, even it is most important for us):

- Additional database access every time when you want to insert a row, to calculate next key value.

- Need to lock table in transaction during these operations, because of possible errors when more than one user insert rows simultaneously. AFAIK, you cannot start transactions against free tables, so you must use database to do this.

I am not VFP specialist - I work in .NET area and my goal is to use different databases with the same code. Thus, my interests into VFP area are limited to databases and VFP OLE DB Provider. So if you know a way to resolve this issue, feel free to discuss it with me.

Plamen
UT memeber#47341
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform