I have read every question on this site having to do with SaveAsText (and other version-control-with-Access related questions).
The most helpful one so far was this one. I am using a slightly modified version of the VBScript code posted in Oliver's answer to save my objects as text files. My application is an .adp, and the database (which obviously includes the Stored Procedures) is SQL Server 2005.
I have attempted to add this code to my VBScript, but I consistently get an error that says "You have cancelled the previous operation" when the SaveAsText line is hit.
For Each myObj In oApplication.CurrentData.AllStoredProcedures
WScript.Echo " " & myObj.fullname
oApplication.SaveAsText acQuery, _
myObj.fullname, _
sExportpath & "\" & myObj.fullname & ".sql"
dctDelete.Add "RE" & myObj.fullname, acQuery
Next
Based on the response in this question, I made sure to add
Const acQuery = 1
to the top of the file.
Also, this code
For i = 0 To oApplication.CurrentDatabase.QueryDefs.Count - 1
oApplication.SaveAsText acQuery, _
oApplication.CurrentDatabase.QueryDefs(i).Name, _
sExportpath & "\" & db.QueryDefs(i).Name & ".sql"
Next i
did not work, but I believe that was intended for a .mdb anyway, not an .adp. Is there any solution for exporting StoredProcedures (and Views or Table definitions, while we're at it) to text files?