Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Inserting into a .dbf GENERAL field from C#
Versions des environnements
Network:
Windows 2003 Server
Hi All;
We have a VFP application that adds records to a .dbf free table and updates an OLE General field with a pointer to a Word Document. The VFP code that works is listed below.
USE FILE1
APPEND blank
REPLACE z_date with date()
REPLACE z_id with recid
REPLACE z_type with 'AFW2_2'
APPEND GENERAL z_data FROM ”c:\test\myresume.doc” CLASS MICROSOFTWORD
We are trying to replicate this in C#. We can do everything but insert the link into the General field. What we have below is as close as we can come using the VFP ODBC connector to accomplish the same results as the VFP code above.
DBCommand = DBConnection.CreateCommand();
DBCommand.CommandText = "insert into FILE1 (Z_DATE,Z_ID,Z_DATA)" +
" values (Date()," +
"'" + Sage_OrgID + "'," +
"'')";
DBCommand.ExecuteNonQuery();
DBCommand.Dispose();
Is there some special trick to getting data into these General Fields? I remember have to fool around with it to get the VFP code working originally . Any assistance would be greatly appreciated.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement