Information générale
Catégorie:
COM/DCOM et OLE Automation
>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
How do you execute it in SQL Server?
Just a note, temporary tables exist during the current connection/session.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement