检索存储的proc名称 [英] Retrieve Stored proc name

查看:58
本文介绍了检索存储的proc名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Access检索存储的查询信息

的常用方法是什么(如果有的话)。 MDAC不支持OleDbSchemaGuid.Procedure_Columns。我需要存储过程名称和参数信息,你能得到这个吗?

what is a common method, if any, to retrieve stored query information
from Access. MDAC does not support OleDbSchemaGuid.Procedure_Columns. I
need stored procedure name and paramter information, can you get this?

推荐答案

如果你是在Access中你可以这样做:


Sub GetQryInfo()

Dim DB As Database,QD As QueryDef,str1 As String

设置DB = CurrentDB

每个QD在DB.QueryDefs中

Debug.Print QD.Name

Debug.Print QD.Sql

下一页

结束子


这将打印出Access mdb中所有查询的名称和

也会在每个查询中打印出sql字符串。如果您从VB6应用程序执行此操作,那么只需引用Microsoft Access

对象库。然后你可以使用


Dim app As Access.Application

设置app = CreateObject(" Access.Application")

或者

如果Access已经运行,则设置app = GetObject(,Access.Application)

Rich


***通过开发人员指南 http://www.developersdex.com 发送***

不要只是参加USENET ...获得奖励!
If you are in Access you can do this:

Sub GetQryInfo()
Dim DB As Database, QD As QueryDef, str1 As String
Set DB = CurrentDB
For Each QD In DB.QueryDefs
Debug.Print QD.Name
Debug.Print QD.Sql
Next
End Sub

This will print out the names of all the queries in an Access mdb and
will also print out the sql string inside each query. If you are doing
this from a VB6 app, then just make a reference to the Microsoft Access
Object Library. You can then use

Dim app As Access.Application
Set app = CreateObject("Access.Application")
or
Set app = GetObject(, "Access.Application") if Access is already running

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


不确定是否会从服务器检索存储过程。


peter walker


Rich P < RP ***** @ aol.com>在消息新闻中写道:42 ********** @ 127.0.0.1 ...
Not sure that will retrieve stored procedures from a server.

peter walker

"Rich P" <rp*****@aol.com> wrote in message news:42**********@127.0.0.1...
如果你在Access中你可以这样做:

Sub GetQryInfo()
Dim DB As Database,QD As QueryDef,str1 As String
Set DB = CurrentDB
For Each QD in DB.QueryDefs
Debug.Print QD.Name
Debug.Print QD.Sql
下一页

这将打印出Access mdb中所有查询的名称,
也将打印出来每个查询中的sql字符串。如果您正在从VB6应用程序执行此操作,那么只需引用Microsoft Access
对象库。然后你可以使用

Dim app As Access.Application
设置app = CreateObject(" Access.Application")

设置app = GetObject(,& ; Access.Application")如果Access已经运行

Rich

***通过Developersdex发送 http://www.developersdex.com ***
不要只是参加USENET ......获得奖励!
If you are in Access you can do this:

Sub GetQryInfo()
Dim DB As Database, QD As QueryDef, str1 As String
Set DB = CurrentDB
For Each QD In DB.QueryDefs
Debug.Print QD.Name
Debug.Print QD.Sql
Next
End Sub

This will print out the names of all the queries in an Access mdb and
will also print out the sql string inside each query. If you are doing
this from a VB6 app, then just make a reference to the Microsoft Access
Object Library. You can then use

Dim app As Access.Application
Set app = CreateObject("Access.Application")
or
Set app = GetObject(, "Access.Application") if Access is already running

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!



jw*****@gmail.com 新闻:1109711904.529069.185500

@ f14g2000cwb.googlegroups.com:
jw*****@gmail.com wrote in news:1109711904.529069.185500
@f14g2000cwb.googlegroups.com:
检索存储的查询信息的常用方法是什么?
来自Access。 MDAC不支持OleDbSchemaGuid.Procedure_Columns。我需要存储过程名称和参数信息,你能得到这个吗?
what is a common method, if any, to retrieve stored query information
from Access. MDAC does not support OleDbSchemaGuid.Procedure_Columns. I
need stored procedure name and paramter information, can you get this?




你可以用T-SQL字符串获取SQL程序的ID和名称像这样。


" SELECT ID,name FROM SysObjects WHERE xtype =''P''"


你可以使用这些ID返回获取Sprocs的T-SQL

with


" SELECT text FROM SysComments WHERE ID =" &安培; ID


这假设您拥有权限和一些编程能力。



You can get the ID and Name of SQL procedures with a T-SQL string like this.

"SELECT ID, name FROM SysObjects WHERE xtype=''P''"

You can use the IDs returned to get the T-SQL of the Sprocs
with

"SELECT text FROM SysComments WHERE ID=" & ID

this assumes you have permissions and some programming ability.


这篇关于检索存储的proc名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆