Executing FoxPro Command  
Author Message
Novelle





PostPosted: Visual FoxPro General, Executing FoxPro Command Top

hi guys!

well by the way my database connection is a ADODB connection. now i would like to execute a FoxPro command like:

use myTable

append from myTable

i dont know how to execute this in VB6. can someone tell me how it works

that will be great! thanks

--novelle



Visual FoxPro1  
 
 
CetinBasoz





PostPosted: Visual FoxPro General, Executing FoxPro Command Top

VFPOLEDB driver supports use and append from only from within a stored procedure.

You can instead use:

insert into myTable (< fieldlist here> ) select < fieldlist here > from otherTable

If structures match then shortcut form:

insert into myTable select * from otherTable


 
 
Novelle





PostPosted: Visual FoxPro General, Executing FoxPro Command Top

hi there!

i've forgot to mentioned that my tables are in dbase III (so .dbf files)

so you think i can do this:

with Connection

.Open "hier the ConnectionStrings"

.Execute "INSERT INTO myTable SELECT * FROM otherTable"

.Close

end With

do you think it works like this i've tried it but the otherTable is still empty.

is theres no way to use FoxPro command it will be easier if i can use such command:

APPEND FROM myTable

thanks


 
 
CetinBasoz





PostPosted: Visual FoxPro General, Executing FoxPro Command Top

dBaseIII format is fully compatible with fox2x format and VFPOLEDB works with them wonderfully well. I think you made some error in your syntax. You're inserting into myTable from otherTable. It looks like:

use myTable

append from otherTable