Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling a Stored Procedure from VFP9
Message
De
07/09/2012 11:08:39
 
 
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:
01552561
Vues:
47
>>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
>
>What is your SQL Server version? Are you able to run SQL Server Profiler and examine what you're sending to SQL Server?
>
>Also, are you connected to the right database?

SQL 10, how would I do that?

Yes, the connection is good and is to the correct DB
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform