19 if (!defined(
'ADODB_DIR'))
die();
21 if (!defined(
'_ADODB_ADO_LAYER')) {
22 if (PHP_VERSION >= 5) include(ADODB_DIR.
"/drivers/adodb-ado5.inc.php");
23 else include(ADODB_DIR.
"/drivers/adodb-ado.inc.php");
31 var
$sysDate =
'convert(datetime,convert(char,GetDate(),102),102)';
49 return $this->GetOne(
'select SCOPE_IDENTITY()');
54 return $this->GetOne(
'select @@rowcount');
59 $this->_transmode = $transaction_mode;
60 if (empty($transaction_mode)) {
61 $this->Execute(
'SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
64 if (!stristr($transaction_mode,
'isolation')) $transaction_mode =
'ISOLATION LEVEL '.$transaction_mode;
65 $this->Execute(
"SET TRANSACTION ".$transaction_mode);
68 function qstr($s,$magic_quotes=
false)
70 $s = ADOConnection::qstr($s, $magic_quotes);
71 return str_replace(
"\0",
"\\\\000", $s);
76 $table = strtoupper($table);
78 $dbc = $this->_connectionID;
83 $osoptions[2] = $table;
86 $adors=@$dbc->OpenSchema(4, $osoptions);
90 $fld =
new ADOFieldObject();
91 $c = $adors->Fields(3);
92 $fld->name = $c->Value;
94 $fld->max_length = -1;
95 $arr[strtoupper($fld->name)]=$fld;
102 return empty($arr) ? $false : $arr;
108 $this->Execute(
'BEGIN TRANSACTION adodbseq');
110 $this->Execute(
"create table $seq (id float(53))");
111 $ok = $this->Execute(
"insert into $seq with (tablock,holdlock) values($start)");
113 $this->Execute(
'ROLLBACK TRANSACTION adodbseq');
116 $this->Execute(
'COMMIT TRANSACTION adodbseq');
120 function GenID($seq=
'adodbseq',$start=1)
123 $this->Execute(
'BEGIN TRANSACTION adodbseq');
124 $ok = $this->Execute(
"update $seq with (tablock,holdlock) set id = id + 1");
126 $this->Execute(
"create table $seq (id float(53))");
127 $ok = $this->Execute(
"insert into $seq with (tablock,holdlock) values($start)");
129 $this->Execute(
'ROLLBACK TRANSACTION adodbseq');
132 $this->Execute(
'COMMIT TRANSACTION adodbseq');
135 $num = $this->GetOne(
"select id from $seq");
136 $this->Execute(
'COMMIT TRANSACTION adodbseq');
MetaColumns($table, $normalize=true)
CreateSequence($seq='adodbseq', $start=1)
ADORecordSet_ado_mssql($id, $mode=false)
GenID($seq='adodbseq', $start=1)
qstr($s, $magic_quotes=false)
SetTransactionMode( $transaction_mode)