Important alert: (current site time 7/15/2013 10:16:47 PM EDT)
 

article

A GetData example

Email
Submitted on: 5/18/2004 10:45:54 AM
By: zd 
Level: Intermediate
User Rating: By 4 Users
Compatibility: ASP (Active Server Pages)
Views: 11580
author picture
(About the author)
 
     ' simple yet effective little piece of code to retrieve ' a single value from any SQL compliant data source. Handy for retrieving ID's, Descriptions or whatever!

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
				' Author:	zd
' Input:	SQL to retrieve data with
' 		The index of the field you wish to retrieve
' Return:	The value of the field
' Assume:	Connection is established as [conn]...
Public Function GetData(vstrSQL, vintFieldIndex)
dim rs
	rs.open vstrSQL, conn, 2, 1
		if not rs.eof and not rs.bof then
			GetData = rs.fields(vintFieldIndex)
		end if
	rs.close
End Function


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
5/19/2004 7:32:06 AMDeepak Kumar Shaw

whats is that???
(If this comment was disrespectful, please report it.)

 
5/21/2004 2:17:33 AM

sdfsdfsdf
(If this comment was disrespectful, please report it.)

 
8/29/2004 3:03:04 PM

like to see it
(If this comment was disrespectful, please report it.)

 
10/15/2004 6:28:51 AM

this is a very good site.

thank u
(If this comment was disrespectful, please report it.)

 
1/8/2005 4:31:55 AM

This's so good. thanks, i like this website very much
(If this comment was disrespectful, please report it.)

 
8/25/2005 8:19:55 AMYusuf

I cant see any codes to download
(If this comment was disrespectful, please report it.)

 
8/20/2006 4:46:10 AMyousif

yes
(If this comment was disrespectful, please report it.)

 
10/17/2006 9:16:19 AMasd

r u nuts
(If this comment was disrespectful, please report it.)

 
1/23/2007 12:06:12 PMsugar

asp help
(If this comment was disrespectful, please report it.)

 
1/30/2008 2:17:19 AMMr Tuyen

Please send help me! Thanks!
(If this comment was disrespectful, please report it.)

 
12/20/2008 10:28:18 AMbosss

thanks for helping me
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.