How To Call System-Stored Procedures on SQL Server from RDO (153234)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q153234 SUMMARY
This 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
REFERENCES
Hitchhiker's Guide to Visual Basic and SQL Server, Microsoft Press.
ISBN: 1-55615-906-4.
Modification Type: | Minor | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbhowto KB153234 |
---|
|