DB_SettingRead_Field

Returns a certain field from Settings table by a SettingName.
Similar to DB_SettingRead, except here you can control which field to return, not only the 'Value' field.

Function DB_SettingRead_DateAdded(SettingID)
 DB_SettingRead_DateAdded = DB_SettingRead_Field(SettingID, 5)
End Function
Function DB_SettingRead_DateModified(SettingID)
 DB_SettingRead_DateModified = DB_SettingRead_Field(SettingID, 6)
End Function
Function DB_SettingRead_Field(SettingID, FieldNo)
 DB_SettingRead_Field = "{{$N/A$}}"
 SQLSt      = "Select * from [Settings] where [SettingName]='" & SettingID & "' "
 Set recordsetF   = oConn.execute(SQLSt)
 if recordsetF.eof Then Exit Function
 DB_SettingRead_Field = Trim(RecordSetF(FieldNo).value)
 Set RecordsetF   = Nothing
End Function

SettingID, FieldNo

DB_SettingRead_DateAdded = DB_SettingRead_Field(SettingID, 5)<br/>DB_SettingRead_DateModified = DB_SettingRead_Field(SettingID, 6)

Views 465 Downloads 139

'Connection to db', 'DB', 'Database', 'Setting', 'Settings', 'ANStr', 'ANString', 'ANStrList', 'DB_SettingRead', 'DB_Setting2Read'

ANmarAmdeen
324
Database Classic ASP
Revisions

v1.0