scripting@wanadoo.nl




DBRecordsetOpen()

http://www.scriptlogic.com/kixtart/FunctionLibrary_FunctionList.aspx


actual FunctionLibrary list on 'Scriptlogic' site printer-friendly mirror of UDF topic on 'scripting@wanadoo.nl' site close
13 May 2002 DBRecordsetOpen()
AuthorJens Meyer (sealeopard@usa.net)
Action Opens a recordset object from a database.
SyntaxDBRecordsetOpen (connection, SQL [,cmdType, curType, lockType]) 
Parameters
  • connection (Required / String) open connection object to a data source
  • SQL (Required / String) SQL query to be executed
  • cmdType (Optional / Numeric) optional integer value denoting the command type
  • curType (Optional / Numeric) optional integer value denoting the cursor type
  • lockType (Optional / Numeric) optional integer value denoting the lock type 
  • RemarksThe recordset object must be closed with DBRecordsetClose()

    KIXTART BBS http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=12;t=000198 
    ReturnsRecordset object 
    DependenciesNone. 
    Examples
    $objConn = DBConnOpen('DRIVER={Microsoft Access Driver (*.mdb)}; UID=; PWD=; DBQ=database.mdb')
    $recordset = DBRecordsetOpen($objConn,'')
    $retcode = DBRecordsetClose($recordset)
    $retcode = DBConnClose($objConn)
    
     
    Source
    FUNCTION DBRecordsetOpen ($objconn, $sql, OPTIONAL $cmdtype, OPTIONAL $curtype, OPTIONAL $locktype)
      DIM $cmdcommand, $rsrecordset
      DIM $records, $rowdelimiter, $columndelimiter
      DIM $adcmdunspecified, $adcmdtext, $adcmdtable, $adcmdstoredproc, $adcmdunknown, $adcmdfile, $adcmdtabledirect
      DIM $adlockunspecified, $adlockreadonly, $adlockpessimistic, $adlockoptimistic, $adlockbatchoptimistic
      DIM $adopenunspecified, $adopenforwardonly, $adopenkeyset, $adopendynamic, $adopenstatic
      DIM $adclipstring, $adstateopen
    
      $rowdelimiter=Chr(10)+Chr(10)
      $columndelimiter=Chr(10)
    
      $adlockunspecified     = -1
      $adlockreadonly        = 1
      $adlockpessimistic     = 2
      $adlockoptimistic      = 3
      $adlockbatchoptimistic = 4
    
      $adopenunspecified = -1
      $adopenforwardonly = 0
      $adopenkeyset      = 1
      $adopendynamic     = 2
      $adopenstatic      = 3
    
      $adclipstring = 2
    
      $adstateopen = 1
    
      $adcmdunspecified = -1
      $adcmdtext        = 1
      $adcmdtable       = 2
      $adcmdstoredproc  = 4
      $adcmdunknown     = 8
      $adcmdfile        = 256
      $adcmdtabledirect = 512
    
      IF VarType($cmdtype)
        $cmdtype=Val($cmdtype)
      ELSE
        $cmdtype=$adcmdtext
      ENDIF
      IF VarType($curtype)
        $curtype=Val($curtype)
      ELSE
        $curtype=$adopenstatic
      ENDIF
      IF VarType($locktype)
        $locktype=Val($locktype)
      ELSE
        $locktype=$adlockreadonly
      ENDIF
      IF VarType($objconn) <> 9 OR $sql = ''
        EXIT 87
      ENDIF
    
      $cmdcommand = CreateObject('ADODB.Command')
      IF @error
        EXIT @error
      ENDIF
      $rsrecordset = CreateObject('ADODB.Recordset')
      IF @error
        EXIT @error
      ENDIF
      $cmdcommand.activeconnection = $objconn
      IF @error
        EXIT @error
      ENDIF
      $cmdcommand.commandtype = $cmdtype
      IF @error
        EXIT @error
      ENDIF
      $rsrecordset.cursortype = $curtype
      IF @error
        EXIT @error
      ENDIF
      $rsrecordset.locktype = $locktype
      IF @error
        EXIT @error
      ENDIF
      $cmdcommand.commandtext = $sql
      IF @error
        EXIT @error
      ENDIF
    
      $rsrecordset.open($cmdcommand)
      IF @error
        EXIT @error
      ENDIF
    
      $dbrecordsetopen=$rsrecordset
    
      $rsrecordset=''
      $cmdcommand=''
    ENDFUNCTION ; - DBRecordsetOpen -
     
      original source of UDF topic. show actual FunctionLibrary list on Scriptlogic site close top
              printer-friendly mirror of UDF topic on scripting@wanadoo.nl site  




    Copyright © 2003 www.scriptlogic.com & scripting@wanadoo.nl - last updated on 20 May 2003


    Site Meter