Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLEDB coding question
Message
 
 
À
12/09/2003 11:18:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00828505
Message ID:
00828535
Vues:
15
Try to add
oCmd.CommandType = adCmdStoredProc
>Try this: I actually stepped through this and it gets the same non-result as that which is in my application.
>
>LOCAL cAlias, cConnectString, oCmd, oConn, oOLEDB, oRslt, cCmdString
>cConnectString	= 'PROVIDER=SQLOLEDB.1;Data Source=DEVELOPER\VSDotNET;Integrated Security=SSPI;Initial Catalog=MyDB; '
>cCmdString		= "Logon_Request 'sa', ''"
>cAlias			= 'Access'
>
>oCmd	= CREATEOBJECT( 'ADODB.Command' )
>oConn	= CREATEOBJECT( 'ADODB.Connection' )
>oOLEDB	= CREATEOBJECT( 'vfpcom.comutil' )
>oRslt	= CREATEOBJECT( 'ADODB.RecordSet' )
>
>oConn.ConnectionString	= cConnectString
>oConn.Open()
>oCmd.ActiveConnection	= oConn
>oCmd.CommandText	= cCmdString
>oRslt.CursorType	= 3  && adOpenStatic
>oRslt.LockType		= 3  && adLockOptimistic
>oRslt.Open( oCmd )
>
>oOLEDB.RsToCursor( oRslt, cAlias )
>This is the command that PROFILER captures:
>exec Logon_Request 'sa', ''
>
>When I copy the SQL code into query analyzer, it works. If I call a stored procedure that doesn't accept parameters, it works. If I pass a select statement, it works too. It's just parameterized stored procedure calls that isn't working. I suspect it is working, but I'm not correctly capturing the result data.
>
>>Hi Ken,
>>
>>I don't see that your code sends any queries to the SQL Server.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform