能否写一种在数据库窗口查询标签里面看不见的查询?(view/Procedures)《查询》-----access2000下适用
如何显示,察看在数据库窗口查询标签里面看不见的查询?-----access2000下适用
如何用jet sql创建查询(存储过程/视图)?
Function createProVie()
Dim conn As New ADODB.Connection
Set conn = CurrentProject.Connection
conn.Execute "create Procedure name3(kk int) as select * from msysobjects where type=kk "
conn.Execute "create View name2 as select * from msysobjects"
conn.Close
Set conn = Nothing
End Function
Function createPro()
Dim conn As New ADODB.Connection
Dim dbpath As String
dbpath = CurrentProject.Path & "\" & CurrentProject.Name '这里写你的mdb路径
Dim strconn As String
strconn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath
Debug.Print strconn
conn.Open strconn
conn.Execute "create Procedure name1(kk int) as select * from msysobjects where xtype=kk"
conn.Execute "create View name2 as select * from msysobjects"
conn.Close
Set conn = Nothing
End Function
Function dispAllProVie()
Dim cat As New ADOX.Catalog
Dim cmd As ADODB.Command
cat.ActiveConnection = CurrentProject.Connection
Dim pro As ADOX.Procedure
For Each pro In cat.Procedures
Debug.Print "pro: " & pro.Name
Set cmd = pro.Command
Debug.Print cmd.CommandText
Next
Dim vie As ADOX.View
For Each vie In cat.Views
Debug.Print "vie: " & vie.Name
Set cmd = vie.Command
Debug.Print cmd.CommandText
Next
End Function