Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Working with ADO
Message
From
22/10/2001 18:17:30
 
 
To
17/10/2001 14:53:18
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00569691
Message ID:
00571895
Views:
29
Thanks Daniel

I have used ADO(Active X Object ) in Visual Foxpro program to connect with the SQL SERVER backend. I want to run the stored procedures in SQL SERVER from the foxpro. The stored procedure copies the records in the table called temp_header. I used the command object of the ADO to accomplish this. When I execute this stored procedure from within the SQL SERVER, it copies 50 rows to the temp_header in SQL SERVER. When I run the same from the VFoxpro, it seems to work but copies only 4 rows instead of 50. I used the following code.

*!* Run the stored Procedures....
# include d:\ADO.H
#DEFINE ADOPENKEYSET 1
#DEFINE ADLOCKPESSIMISTIC 2
#DEFINE ADLOCKOPTIMISTIC 3
#DEFINE ADOACTIVECONNECTION 4
#DEFINE ADCMDSTOREDPROC 5

Public oConnection as Object
Public oRecordset As Object
Public oCommand as Object

oConnection = createobject("adodb.connection")
oConnection.Open("Provider=MSDASQL;SERVER=HDS_SQLSERVER1;DATABASE=nms_jfm;DRIVER={SQL SERVER};uid=sa;pwd=sa")
oRecordset = CreateObject("adodb.recordset")
oRecordset.open("select * from _4_CLAIM_DBF_TEMP", oConnection, ADOPENKEYSET, ADLOCKOPTIMISTIC)
oCommand = CreateObject("adodb.command")
oCommand.ActiveConnection = oConnection
oCommand.commandText = "sp_AdvanceClaim_BH"
oCommand.execute
wait window 'Executed the sp_AdvanceClaim_BH' Nowait


The above code transfers only first 4 records to the required table instead of 50.
Thanks
Bharat
Previous
Reply
Map
View

Click here to load this message in the networking platform