Discussion Locked

run other program on VB6's prog

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Can u tell me on how to working with other program when the vb6 program is running? example: i am using vfp as database... and a vb6's program... when i want to access to vfp like ask vfp to remove all the deleted record through vb6's program, i need to have vfp command in my program, right??

Can someone tell me how to do with this? Thank you....

Eve

5 replies

by glen_mcleod

Just like you'd manipulate any other database from VB. You can send SQL commands to the data engine to be executed, or use the metnods of your data access layer. Either way you have to first connect to the database using ADO, RDO, or something similar.

Using ADO to send an SQL command:

myADOConnectionObject.Execute "Delete * from Employees Where EmpID = 415"

Using ADO object methods:

myADORecordsetObject.Delete

Glen

by poois

Thank you..... but this is not what i want to ask...... the question is how do i running the vfp's function like "PACK" after i remove the selected data..... and somemore like "set date dmy" :)

by glen_mcleod

That's what the first syntax is for. By using the .Execute method, you can pass (just about) any valid executable DML or DDL command to your data engine.

Glen

by poois

Glen,
Can u give me a very simple example on how to execute to the DML or DLL command?? like what code do i need to type on VB6 to set the date format of vfp to DMY..... as i know .execute is only can use to access to database only... i am a bit confuse with this.... TQ

by andrew

If you can't do what you want through DDL or DML, you'll have to use VB to access the VFP automation interface. Here's a small example:

Set oTest = CreateObject("foxole.person")
cName$ = oTest.GetName()

Use the VB references dialog & the Object Browser to find and examine these interfaces for the functionality you need.

This discussion is closed to new replies.