Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling a Stored Procedure from VFP9
Message
De
07/09/2012 14:28:07
 
 
À
07/09/2012 09:54:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
MS SQL Server
Divers
Thread ID:
01552550
Message ID:
01552593
Vues:
39
What is the value of ms1 both times?


>Hi again.
>
>Since I couldn't get the SQL passthrough to work, I moved the code into a stored procedure, which is ok because I'm gonna need this SP anyway.
>
>Here is the calling code:
>
>   m.ErrorMsg = ""
>   m.sqlcmd = "Execute dbo.InsertMaster "
>   m.param1 = "?m.cat, ?m.diff, ?m.alc, ?m.keyword, ?m.keyword2, ?m.correctresp,  ?m.script, ?m.stem, "
>   m.param2 = "?ALLTRIM(m.respa), ?ALLTRIM(m.respb), ?ALLTRIM(m.respc), ?ALLTRIM(m.respd), ?m.scripttime, "
>   m.param3 = "?m.testtype, ?m.itmnum, ?m.cb, ?m.cd, ?m.rb, ?m.rd, ?m.completed,  ?m.wtavgmea, ?m.error, ?m.wtavginfit, ?m.wtavgoutft, ?m.pbiscrl, "
>   m.param4 = "?m.pa,  ?m.pb, ?m.pc, ?m.pd, ?m.subbank,?@ErrorMsg"
>   
>   ms1 = SQLEXEC(mconn, m.sqlcmd + m.param1 + m.param2 + m.param3 + m.param4)
>   IF !EMPTY(m.ErrorMsg)
>     =MESSAGEBOX(m.ErrorMsg, 16)
>   endif
>
>
>This is in a scan loop.
>
>The first time through everything runs with no errors reported, but no insert. The second time it comes back and tells me it can't find 'dbo.InsertMaster'.
>
>If I run the SP on it's own and hand enter the data elements, it works just peachy. This is a little crazy making and I'm starting to enjoy beating my head against this brick wall.
>
>Again, what am I missing? I wouldn't be bothering y'all so much, but we have no DBA here, nor do we have anyone with any experience programming with anything outside of Access.
>
>Thanks
>Dorris
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform