How To Call System-Stored Procedures on SQL Server from RDOLast reviewed: July 3, 1996Article ID: Q153234 |
The information in this article applies to:
SUMMARYThis article describes how to call system-stored procedures on SQL Server from RDO. SQL Server has a number of prewritten, stored procedures that are used to configure and administer the SQL server. All of these procedures have the prefix "sp_" that distinguishes them from user- or application-written stored procedures. In order to call these stored procedures from RDO, you must specify the correct database is which they reside, the master database. There are several ways to do this, but the most effective way is to explicitly reference the stored procedure in your call syntax. For example:
{ ? = call master.dbo.sp_addlogin(?,?) }Another method to accomplish this behavior is to set the default database before creating and executing your stored procedure. The following example uses a prepared statement and assumes that "Pubs" is your default database:
<Object>.Execute "Use Master" 'rdoConnection object Set <Object> = <Object>.CreatePreparedStatement("", strSQL) <Object>.Execute 'rdoPreparedStatement object <Object>.Execute "Use Pubs" 'rdoConnection object MORE INFORMATION
REFERENCESHitchhiker's Guide to Visual Basic and SQL Server, Microsoft Press. ISBN: 1-55615-906-4.
|
Additional reference words: 4.00 vb4win vb432
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |