Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using VFPOleDB and Set EngineBehavior
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01052518
Message ID:
01052550
Views:
20
This message has been marked as a message which has helped to the initial question of the thread.
Here is some sample ADO code that demonstrates how to set ENGINEBEHAVIOR in the provider:
clear 
local loConn as adodb.connection
local loRS as adodb.recordset 

loConn = CREATEOBJECT('ADODB.Connection')
lcPath = _vfp.DefaultFilePath
loConn.ConnectionString = "Provider=VFPOLEDB.1;Data Source="+lcPath +";Mode=ReadWrite;Password='';Collating Sequence=MACHINE"
loConn.Open
? loConn.Properties('Provider version').value 
loRs = loConn.Execute("=SET('enginebehavior')")
? loRS.fields(0).name,Transform(loRS.fields(0).value)
loRs.Close
loConn.Execute("SET ENGINEBEHAVIOR 70")
loRs = loConn.Execute("=SET('enginebehavior')")
? loRS.fields(0).name,Transform(loRS.fields(0).value)
loRs.Close
loConn.Close
return 
The return values show the setting before and after the setting is made.

>I see,so when ever the COM executes an SQL. I should send the SET ENGINEBEHAVIOR statment before I send the SQL command. Correct?
>
>>Hi Bret,
>>
>>I guess I wasn't clear. The SET ENGINEBEHAVIOR in the VFP code has no effect on the VFP OLE DB provider. You'll have to send SET ENGINEBEHAVIOR 70 to the provider.
>>
>>>Thanks Sergey. Now I just need to place the statement into a set of COM Dll's and test if that works. I have ran a couple of tests where it indicates to me that EngineBehavior is set to 70, but the OleDb cll to execute an SQL seems to have a problem. I figured I would set engine behavior right before the call to OleDb, but that did not seem to work. That is what made me ask if OleDb undertands that I set EngineBehavior.
>>>
Jim Saunders
Microsoft
This posting is provided “AS IS”, with no warranties, and confers no rights.
Previous
Reply
Map
View

Click here to load this message in the networking platform