zoukankan      html  css  js  c++  java
  • 从数据库取数据

     '/----------------------------------------------------------------------------------------------
        '/  処理名  :フィールドデータ取得
        '/
        '/  機能    :フィールドの内容を取得する
        '/
        '/  引数    :ioHandle      :データベースハンドル構造体(DB_HANDLE)
        '/            iFiledName    :フィールド名
        '/
        '/  戻値    :DB_Data       :データ
        '/
        '/----------------------------------------------------------------------------------------------
        '/  2003/02/05             新規作成
        '/----------------------------------------------------------------------------------------------
        '/
        Public Function DB_Data(ByRef ioHandle As DB_HANDLE, ByRef iFiledName As String) As Object
    
            Dim plReturn As Object
    
            plReturn = System.DBNull.Value
            Try
                Select Case ioHandle.Recordset.Columns(iFiledName).DataType.ToString() '/ データ型によりNull変換
                    Case "System.Boolean"
                        plReturn = NullToBoolean(ioHandle.Recordset.Rows(ioHandle.CurrentRowIndex)(iFiledName).ToString()) '/ -- フィールドの内容を取得(ブール)
                    Case "System.String"
                        plReturn = NullToString(ioHandle.Recordset.Rows(ioHandle.CurrentRowIndex)(iFiledName).ToString()) '/ -- フィールドの内容を取得(文字型)
                    Case "System.DateTime"
                        plReturn = NullToDate(ioHandle.Recordset.Rows(ioHandle.CurrentRowIndex)(iFiledName).ToString())   '/ -- フィールドの内容を取得(日付時刻型)
                    Case "System.Numeric", "System.Decimal", "System.Double"
                        plReturn = NullToDouble(ioHandle.Recordset.Rows(ioHandle.CurrentRowIndex)(iFiledName).ToString()) '/ -- フィールドの内容を取得(実数型)
                    Case "System.Int", "System.Int32", "System.Int16"
                        plReturn = NullToLong(ioHandle.Recordset.Rows(ioHandle.CurrentRowIndex)(iFiledName).ToString())   '/ -- フィールドの内容を取得(整数型)
                    Case Else
                        Stop
                End Select
            Catch ex As Exception
                basLog.ErrorLogging(cmMODULE_NAME, "DB_Data", Err.Number)
            End Try
            Return plReturn
    
        End Function
    

      

  • 相关阅读:
    Lazy Load, 延迟加载图片的 jQuery 插件(转)
    获取python的版本&获取两个日期的天数差值
    基于appnium+python+夜神模拟器的自动化
    Appium安装部署
    HttpRunner_参数化进阶
    httprunner2.0 概述及使用说明
    httprunner官方文档
    Linux中常用的监控性能的命令(sar、mpstat,vmstat, iostat,)详解
    Linux常用命令大全
    JMeter 事务控制器
  • 原文地址:https://www.cnblogs.com/jiningning/p/4736001.html
Copyright © 2011-2022 走看看