Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Command object in ADO
Message
De
23/10/2001 11:28:57
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00572034
Message ID:
00572078
Vues:
28
This message has been marked as the solution to the initial question of the thread.
>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
Fil
Voir

Click here to load this message in the networking platform