General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only