Sub test1()
Dim Cat As New ADOX.Catalog
Dim Cmd As New ADODB.Command
Dim Tmp_i As Integer
Set Cat.ActiveConnection = CurrentProject.Connection
For Tmp_i = 0 To Cat.Procedures.Count
Debug.Print Cat.Procedures(Tmp_i).Name
Set Cmd = Cat.Procedures(Tmp_i).Command
Debug.Print Cmd.CommandText
Next
End Sub
Dim cnn As New ADODB.Connection
Dim Cat As New ADOX.Catalog
Dim Cmd As New ADODB.Command
Dim Tmp_i As Integer
cnn.Open "rovider=Microsoft.Access.OLEDB.10.0;Data Source=AA\SONG;User ID=***assword=***;Initial Catalog=PX_Data;Data Provider=SQLOLEDB.1"
Set Cat.ActiveConnection = cnn
For Tmp_i = 0 To Cat.Procedures.Count
Debug.Print Cat.Procedures(Tmp_i).Name
Set Cmd = Cat.Procedures(Tmp_i).Command
Debug.Print Cmd.CommandText
Next