VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Returns Table Data! Returns Data over ADO from a given Field in a given Table with a given conditio

by merror (3 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 24th March 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Returns Table Data! Returns Data over ADO from a given Field in a given Table with a given condition. Makes it easier to get the data of only

Rate Returns Table Data! Returns Data over ADO from a given Field in a given Table with a given conditio



'22.3.200 [email protected]
'cnnMain = Open Connection

  On Error GoTo Err_ReturnTableData
    
  Dim rstRec As New ADODB.Recordset
  Dim strSQL As String
    
  Let strSQL = "SELECT " & strReturnField & " FROM " & strTableName & " " & strWhereCondition
    
  rstRec.Open strSQL, cnnMain, adOpenStatic, adLockOptimistic
    
  If rstRec.RecordCount > 0 Then
     ReturnTableData = NullChecked(rstRec(strReturnField))
  Else
     ReturnTableData = ""
  End If

Exit_ReturnTableData:
  Exit Function

Err_ReturnTableData:
  'your error handling here
  Resume Exit_ReturnTableData:

Download this snippet    Add to My Saved Code

Returns Table Data! Returns Data over ADO from a given Field in a given Table with a given conditio Comments

No comments have been posted about Returns Table Data! Returns Data over ADO from a given Field in a given Table with a given conditio. Why not be the first to post a comment about Returns Table Data! Returns Data over ADO from a given Field in a given Table with a given conditio.

Post your comment

Subject:
Message:
0/1000 characters