15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Retrieving Stored. Procs using MFC

Mario Contestabile -- Mario_Contestabile.UOS__MTL@UOSMTL2.universal.com
Thursday, December 05, 1996

Environment: MSVC 4.2b Windows 95

How can I retrieve all the SQL Stored Procedures from an SQL database
using MFC?

mcontest@universal.com




Mike Blaszczak -- mikeblas@nwlink.com
Sunday, December 08, 1996

[Mini-digest: 3 responses]

At 17:45 12/5/96 EDT, Mario Contestabile wrote:
>Environment: MSVC 4.2b Windows 95

>How can I retrieve all the SQL Stored Procedures from an SQL database
>using MFC?

Make a query that does=20

        SELECT *
          FROM sysobjects
         WHERE type =3D 'P'

and read the results.

.B ekiM
http://www.nwlink.com/~mikeblas/
I'm afraid I've become some sort of speed freak.
These words are my own. I do not speak on behalf of Microsoft.

-----From: "Michael J. Morel" 

Are you using ODBC?  And are you looking to get a list of stored procs, o=
r=20
the body of a stored proc?  I can't tell from your question.

If you're looking for a list, you can call the function SQLProcedures in=20
the ODBC API.  It is a level 2 function, so not all drivers support it.=20
 Recent versions of the MS SQL-Server driver do support it.  It returns a=
=20
result set that looks like:
	RFX_Text(pFX, "procedurequalifier", m_procedurequalifier);
	RFX_Text(pFX, "procedureowner", m_procedureowner);
	RFX_Text(pFX, "procedurename", m_procedurename);
	RFX_Long(pFX, "numinputparms", m_numinputparms);
	RFX_Long(pFX, "numoutputparms", m_numoutputparms);
	RFX_Long(pFX, "numresultsets", m_numresultsets);
	RFX_Text(pFX, "remarks", m_remarks);
I have a class that you can use like a recordset to return procedure=20
information.  If you're interested, you can e-mail me offline.

If you are looking to get the body of a stored proc, you'll probably want=
=20
to create a recordset that executes sp_helptext to get it.  (That's if=20
you're using SQL Server).  I'm pretty sure there's no ODBC call to get it=
=20
generically.

Mike Morel
mmorel@mushroomsoft.com
Mushroom Software
Home of MFC For Yourself
http://www.mushroomsoft.com

----------
From: 	Mario Contestabile[SMTP:Mario_Contestabile.UOS__MTL@universal.com]
Sent: 	Thursday, December 05, 1996 4:45 PM
To: 	mfc-l
Subject: 	Retrieving Stored. Procs using MFC

Environment: MSVC 4.2b Windows 95

How can I retrieve all the SQL Stored Procedures from an SQL database
using MFC?

mcontest@universal.com






-----From: Mao Zhihong 

Hi,=20
  You will get the complete answer in your vc 4.2's exacples,=20
  look through :
   \msdev\samples\mfc\database\catalog2
  you will find you can get any avalible database object throw ODBC's
catalog service.
				best reguards
					Mao
>Environment: MSVC 4.2b Windows 95

>     How can I retrieve all the SQL Stored Procedures from an SQL databa=
se
>     using MFC?

>     mcontest@universal.com
--=20
 "M!cr@$@ft'$ D@vbl $p cE is tHe s=E0fteSt h=E0Rd di k c mPre so@#!"
 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D
      Mao Zhihong ( Robert Mao )  DreamyRainbow Software Studio

      Voc/Fax : 86-25-5408086
      E-Mail  : maozhihong@hotmail.com  mao@seu.edu.cn
      URL     : http://seic3.seu.edu.cn/~mao
 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D




| Вернуться в корень Архива |