Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying a table over the network
Message
From
17/10/2006 08:36:31
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/10/2006 08:23:03
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01162466
Message ID:
01162509
Views:
15
No. But you can use execscript to create indexes. (or a series of alter table).
PS: Since I saw it once and never again I think BinaryReader/Writer would do. From within VFP my "repair/structureupdate" routines use CopyFile/MoveFile etc. winAPI just fine.
Cetin

>Hi Cetin
>
>I was looking at the SELECT INTO, but does this copy indexes too?
>
>Thanks
>
>
>>>Hi all
>>>
>>>Sometimes when I copy tables from the network to a local drive they become corrupted.
>>>
>>>Is there any way, from an ADO.Net command, to copy a table using the OLE DB provider? I would imagine this would be safer than simply doing a file copy.
>>>
>>>Thanks
>>>Kev
>>
>>Kevin,
>>I have seen that happen once from a win2K to winXP (or another combination that I don't remember exactly).
>>An OleDbCommand should do what you want. ie:
>>
>>using System;
>>using System.Data;
>>using System.Data.OleDb;
>>
>>class copyTables
>>{
>>  static void Main() {
>>  string strCn =
>>  @"Provider=VFPOLEDB;Data Source=" +
>>  @"C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\SAMPLES\northwind\northwind.dbc";
>>  OleDbConnection cn = new OleDbConnection(strCn);
>>  cn.Open();
>>  OleDbCommand cmd = cn.CreateCommand();
>>  cmd.CommandText =
>>  @"select * from customers into table 'c:\temp\customers' database 'c:\temp\myNewDatabase'";
>>  cmd.ExecuteNonQuery();
>>  cn.Close(); }
>>}
>>
>>PS:Database is optional.
>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform