Groups | Blog | Home
all groups > sql server dts > july 2007 >

sql server dts : Deleting data from vfp table


Cindy Winegarden
7/16/2007 3:49:20 PM
[quoted text, click to view]

Hi,

The FoxPro ZAP command is not available via OLE DB.

Here is a way to create an index via OLE DB with VB code, and similarly a
way to use the ZAP command. I don't have time to try this as part of a DTS
package right now.

Dim cn1 As New OleDbConnection( _
"Provider=VFPOLEDB.1;Data Source=C:\Temp\;")
cn1.Open()
Dim cmd1 As New OleDbCommand("Create Table TestIndex (Field1 I,
Field2 C(10))", cn1)
cmd1.ExecuteNonQuery()
Dim cmd2 As New OleDbCommand( _
"EXECSCRIPT([SELECT 0]+CHR(13)+CHR(10)+[USE TestIndex
EXCLUSIVE]+CHR(13)+CHR(10)+[INDEX ON Field1 TAG Test])", cn1)
cmd2.ExecuteNonQuery()


Dim cn1 As New OleDbConnection( _
"Provider=VFPOLEDB.1;Data Source=C:\Temp\;")
cn1.Open()
Dim cmd1 As New OleDbCommand( _
"EXECSCRIPT([SELECT 0]+CHR(13)+CHR(10)+[USE TestIndex
EXCLUSIVE]+CHR(13)+CHR(10)+[ZAP])", cn1)
cmd1.ExecuteNonQuery()



--
Cindy Winegarden
cindy@cindywinegarden.com

VFP OLE DB: http://msdn2.microsoft.com/en-us/vfoxpro/bb190232.aspx
VFP ODBC: http://msdn2.microsoft.com/en-us/vfoxpro/bb190233.aspx
carloshgo via SQLMonster.com
7/16/2007 4:09:08 PM
Hello!

I'm Creating a DTS to export information into a VFP table but first a need to
delete all existing data from VFP table

I'm using a conecction "Microsoft OLE DB Provider for Visual Fox Pro" between
SQL server 2000 and my VFP free table called "ValidStores.dbf" and i can view
data from VFP table and export data from SQL 2000 to VFP table.

i added a SQL server task object to execute the command to delete the table
but i has been unsucessfull, im have using the following comand lines
delete from ValidStores <-------- does not do anything to the VFP table but
step run sucessfully
ZAP <--------- sents an error message with a none valid command

How could i delete the data inside the table since i dont want to delete the
table because already have a index.

or is there a better way to doit?

Thanks.

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-dts/200707/1
AddThis Social Bookmark Button