General information
Category:
Coding, syntax & commands
Title:
Inserting into a .dbf GENERAL field from C#
Environment versions
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.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only