Re: [PHP-DB] mssql datetime field

2002-07-25 Thread Michael Bretterklieber

Hi,

there exists a workaround in php for this problem. Just put in your php.ini:
mssql.datetimeconvert = 0
or in your script:
ini_set('mssql.datetimeconvert' , 0);

this causes date values in this format: -MM-DD HH24:MI:SS

if it doesen't work correctly, the upgrade to php4.2.1

bye,

[EMAIL PROTECTED] schrieb:
  has anyone had any expierence with the datetime field coming back from
  MSSQL as someting along the lines of February 3, 2036 6:36AM.  This 
happens
  to me no matter the time in the database.  PHP inserts it correctly, but
  the select has a problem.  I am using php4.1.2 and SqlServer 7.0.
 
  Or is anyone haveing success, in new versions of PHP.  Upgrading PHP 
is no
  problem, upgrading SQL is not an option
 
  Thanks in advance.
  Jeff
 
 
 


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] copy a table

2002-07-15 Thread Michael Bretterklieber

HI,

insert into blabla select * from hohohoho

bye,

Matt Babineau schrieb:
 What was the SQL that could be run to copy a table, I want to make a
 duplicate of a table, it just having a different name?
  
 Matt Babineau
 MCWD / CCFD
 -
 e:  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 p: 603.943.4237
 w:  http://www.criticalcode.com/ http://www.criticalcode.com
 PO BOX 601
 Manchester, NH 03105
  
 


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Problems mssql_get_last_message()

2002-07-12 Thread Michael Bretterklieber

Hi,

I have problems with mssql_get_last_message(). This function doesen't 
return the whole error message, it only returns Die Anweisung wurde 
beendet and not the specific error message. Now I use something like 
this to workaround the problem:

... snip ...
$this-errno = mssql_result(@$this-priv_query('SELECT @@ERROR as 
errorcode', $this-dbc), 0 , 'errorcode');
$this-error = mssql_result($this-priv_query(SELECT description FROM 
master.dbo.sysmessages WHERE error=$this-errno and msglangid = 1031, 
$this-dbc), 0, 'description');
$this-error = str_replace ('%', '%%', $this-error);

but the problem is, that I get the error message with placeholders (not 
parsed):
Die %1!-Anweisung verstieß gegen die %2! %3!-Einschränkung '%4!'. Der 
Konflikt trat in der %6!-Datenbank, Tabelle '%8!'%10!%11!%13! auf.)

are there any hints to get mssql_get_last_message() to work?

bye,
-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] catch warnings?

2002-07-10 Thread Michael Bretterklieber

Hi,

try

SELECT @@ERROR as errorcode

bye,

Adam Alkins schrieb:
Hi all!

This is not a typical DB-Question, but I hope you give me some hints
either...

If I insert a String instead of a date(f.Ex) into the DB, I get a
Warning:

MS SQL message: Syntax error converting datetime from character
string. (severity 16) 

How can I catch these warnings in PHP?
 
 
 I believe mssql_get_last_message() is what you want.
 
 --
 Adam Alkins
 http://www.rasadam.com
 --
 
 
 
 


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] OCIPLogon , maximum number of sessions apache/php - Oracle

2002-07-09 Thread Michael Bretterklieber

Hi,

first we when we started up with oracle we had problems with these params:
processes, open_cursors, max_enabled_roles

After a week or so oracle was not able to allocate shared memory, 
something like this:
ORA-04031: unable to allocate 4200 bytes of shared memory (shared
pool,TRIGGER$,sga heap,state objects) ORA-00604: error occurred at

(remember I'm allways talking about Oracle under Linux)

This had 2 reasons:
1. wrong kernel-params (shared-memory-limits and semaphore-limits)
2. a memory leak in Oracle 8.1.7 (applying patchset 3 resolved this)

bye,

Steve Farmer wrote:

 Hi Michael,

 So what you are saying is that apache/php will keep opening sessions 
 until oracle runs out of processes or cursors or memory or hits 
 session_per_user maximum ??

 I was thinking of experimenting with the profile parameter IDLE_TIME 
 Profile Parameter to make oracle close open sessions after a certain 
 amount of time , have you any experience with this?

 I have

 open_cursors  = 500
 processes   = 200
 max_enabled_roles = 30

 regards
 Steve
 At 8:24 AM +0200 9/7/02, Michael Bretterklieber wrote:

 Hi,

 this depends on your settings in the initinstance.ora in the 
 directory /opt/oracle/OraHome1/admin/instance/pfile dir.

 Here are some settings:
 processes = 150
 open_cursors = 300
 max_enabled_roles = 30

 you also have to set the sizes of the shared-memory pool.

 bye,

 Steve Farmer wrote:

 Hi all,

 Does anyone know how many sessions can be opened by apache/php to 
 Oracle using OCIPlogon, or what parameter setting controls this?

 TIA
 Steve



 -- 
 --
 Michael Bretterklieber
 LCP
 JAWA Management Software GmbH
 Liebenauer Hauptstr. 200
 A-8041 GRAZ
 Tel: ++43-(0)316-403274-12
 Fax: ++43-(0)316-403274-10
 GSM: ++43-(0)676-93 96 698
 [EMAIL PROTECTED]
 homepage: http://www.jawa.at
 - privat ---
 E-mail:   [EMAIL PROTECTED]
 homepage: http://www.inode.at/mbretter
 --
 ...the number of UNIX installations has grown to 10, with more 
 expected...
- Dennis Ritchie and Ken Thompson, June 1972



-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972 




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] blob versus file

2002-07-02 Thread Michael Bretterklieber

Hi,

one point that you should keeped in mind is, if you have a cluster of 
webservers connecting to the same db-server, then you have to mount the 
filesystems, where you store the images on all webservers.

On the other hand many db's like oracle have many restrictions with 
lobs. In oracle you can have only one LOB per table. And also functions 
like SELECT DISTINCT or GROUP BY are not supported on LOB-fields.

MySQL is here the positive exception, because MySQL supports such 
functions also on LOB-fields.

We store images and other documents on the filesystem, but text-data 
like session-data ist stored in LOB's,


bye,

Pierre-Alain Joye schrieb:
 On Tue, 2 Jul 2002 05:45:40 +0200
 Andy [EMAIL PROTECTED] wrote:
 
 
is the increase of the network traffic noticable? The query is pretty small
just text. Do u really think this might increase the traffic?
 
 Try to heavely charge a DB with images inside it.
 Do the same without DB, that depends if the dbms is in another server or not, note 
localhost server can use the network interface and not the socket.
 
 then compare the two methods, and use the best :).
 
 Tests are always the best way to get the best methods :).
 
 
 
I also noticed that the image is not cached anymore. Is this true for all
blobs, or do I just access them in a wron way?
 
 Cached ? Client side ?
 
 
 hth
 
 pa
 


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] PHP looses Resource-Id's

2002-06-24 Thread Michael Bretterklieber

Hi,

I found a bug in php4.2.1 (Windows XP, IIS with php as CGI).

- I have a db-class wich stores the resource-id of a db-connection.
- I have a function (itk_new_db) where I return an object of the class 
above and I remember this object in a static-var.
- the second call on that function (itk_new_db) returns the same object, 
but the resource-id is lost!?!?!?

This nice feature also exists with com-objects. This seems to be a cool 
bug in the resource-manager of php.

Any hints? If not I make a bugreport.

class db_class {
var $dbc = null;

function connect() {
$this-dbc = mssql_connect('wincubix', 'oebb', 'oebb');
// 
$this-dbc = mysql_connect('localhost:3308', 'root', '')
}
}

function itk_new_db(){
static $db;

if (!isset($db)) $db = new db_class;

return $db;
}

$db1 = itk_new_db();
$db1-connect();
$db2 = itk_new_db();

if ($db1 === $db2) echo 'identbr';

echo 'S1'.$db1-dbc.'br' ;
echo 'S2'.$db2-dbc.'br'  ;


bye,
-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] PHP looses Resource-Id's

2002-06-24 Thread Michael Bretterklieber

Hi,

not a bug in php a bug in my brain.

returning references from functions only works if you have  on 
function-declaration and call:

$db1 = itk_new_db();
$db1-connect();
$db2 = itk_new_db();

and then it works,

bye,

Michael Bretterklieber schrieb:
 Hi,
 
 I found a bug in php4.2.1 (Windows XP, IIS with php as CGI).
 
 - I have a db-class wich stores the resource-id of a db-connection.
 - I have a function (itk_new_db) where I return an object of the class 
 above and I remember this object in a static-var.
 - the second call on that function (itk_new_db) returns the same object, 
 but the resource-id is lost!?!?!?
 
 This nice feature also exists with com-objects. This seems to be a cool 
 bug in the resource-manager of php.
 
 Any hints? If not I make a bugreport.
 
 class db_class {
 var $dbc = null;
 
 function connect() {
 $this-dbc = mssql_connect('wincubix', 'oebb', 'oebb');
 // $this-dbc = mysql_connect('localhost:3308', 'root', '')
 }
 }
 
 function itk_new_db(){
 static $db;
 
 if (!isset($db)) $db = new db_class;
 
 return $db;
 }
 
 $db1 = itk_new_db();
 $db1-connect();
 $db2 = itk_new_db();
 
 if ($db1 === $db2) echo 'identbr';
 
 echo 'S1'.$db1-dbc.'br' ;
 echo 'S2'.$db2-dbc.'br'  ;
 
 
 bye,


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Innodb and transactions.

2002-06-21 Thread Michael Bretterklieber

Hi,

you have to do something like this:

mysql_query('SET AUTOCOMMIT=0');

mysql_query('COMMIT'); or mysql_query('ROLLBACK');
mysql_query('SET AUTOCOMMIT=1');

bye,

Steve Bradwell schrieb:
 Hi all,
 
 I have just figured out and set up my Innodb on my mysql server so I can use
 transactions Begin, commit, rollback. I'm now looking for examples on how to
 do this with php. I hit the php site and the best I could find was
 fbsql_commit etc... is this what I'm looking for? There's no documentation
 yet. I'm using php4 with mysql 3.23.49-max, and my tables are Innodb.
 
 I appologize if my lingo is somewhat confusing or just wrong but I'm pretty
 new to this stuff.
 
 Any input or examples would be greatly appreciated.
 
 Thanks,
 Steve.
 
 


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Innodb and transactions.

2002-06-21 Thread Michael Bretterklieber

Hi,

use InnoDB, because InnoDB supports row-level locking, and InnoDB also 
supports referential-integrity,

bye,

Steve Bradwell schrieb:
 So should I be using Innodb tables or BDB tables?
 
 Thanks,
 Steve.
 
 -Original Message-
 From: Michael Bretterklieber [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 21, 2002 2:49 AM
 To: Php-Db (E-mail)
 Subject: Re: [PHP-DB] Innodb and transactions.
 
 
 Hi,
 
 you have to do something like this:
 
 mysql_query('SET AUTOCOMMIT=0');
 
 mysql_query('COMMIT'); or mysql_query('ROLLBACK');
 mysql_query('SET AUTOCOMMIT=1');
 
 bye,
 
 Steve Bradwell schrieb:
 
Hi all,

I have just figured out and set up my Innodb on my mysql server so I can
 
 use
 
transactions Begin, commit, rollback. I'm now looking for examples on how
 
 to
 
do this with php. I hit the php site and the best I could find was
fbsql_commit etc... is this what I'm looking for? There's no documentation
yet. I'm using php4 with mysql 3.23.49-max, and my tables are Innodb.

I appologize if my lingo is somewhat confusing or just wrong but I'm
 
 pretty
 
new to this stuff.

Any input or examples would be greatly appreciated.

Thanks,
Steve.


 
 
 


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Retrieving a date from Oracle. Please help!

2002-05-23 Thread Michael Bretterklieber

Hi,

ALTER SESSION SET NLS_DATE_FORMAT=-MM-DD HH24:MI:SS

bye,

maxim wrote:
 Hi all!
 The problem is I can't get expected datetime value from SELECT query on
 Oracle table that has a field of type DATE. Seems like datetime looses its
 time part.
 
 The code is like as follows:
 ...
 $sql = select * from A_TABLE;
 ora_parse($curs, $sql);
 ora_exec($curs);
 ...
 ora_fetch_into($cursor, $r, ORA_FETCHINTO_NULLS);
 foreach ($r as $key = $value) {
 print $key = $value br\n;
 }
 ...
 
 This displays date part only. May be special PHP or Oracle ini parameters or
 environment vars required? Any help appreciated.
 
 Best regards,
 Maxim Bubnov,
 Software Engineer,
 Stelt Telecom NN
 
 
 


-- 
--
--
E-mail: [EMAIL PROTECTED]

JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MSSQL DateTime field formatting?

2002-05-14 Thread Michael Bretterklieber

Hi,

get the latest PHP4 and set set php.ini-param mssql.datetimeconvert to Off

the the MSSQL-Module then returns datetime-values in this format: 
-MM-DD HH24:MI:SS

bye,

Benjamin Walling wrote:

 I can't seem to find a way to format the field that comes back from my
 DateTime fields in MSSQL Server.  For example, '2002-05-13' shows in 
 Query
 Analyzer as 2002-05-13 00:00:00.000.  If I echo it from PHP, I get May 13
 2002 12:00AM.  date() won't take it.  strftime() won't take it.  What 
 do I
 need to do to convert this to a time PHP likes?




-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more 
expected...
   - Dennis Ritchie and Ken Thompson, June 1972



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] wired things with ADO (OLEDB)

2002-05-13 Thread Michael Bretterklieber

Hi,

I have strange problems accessing MSSQL over COM over ADO over OLEDB 
(SQLOLEDB).
In the script below produces the last sql-statement the sql-error (MSSQL 
Errornumber: 242)
*
  Warning*: Invoke() failed: Ausnahmefehler aufgetreten. *Source* : 
Microsoft OLE DB Provider for SQL Server *Description* : Bei der 
Konvertierung eines
  char-Datentyps in einen datetime-Datentyp liegt der datetime-Wert 
außerhalb des gültigen Bereichs. in *D:\adocrash2.php* on line *38*

but the statement is correct. If I use the same recordset no problems, 
but If I use new recordset but with the same Connection, then this error 
occurs the third time opening a new recordset with the same connection. 
I also tries to set again (SET DATEFORMAT ymd), but this statement has 
no effect anymore.

This seems to be a problem with the COM-Module in PHP,

bye,

?php

$conn = new COM( ADODB.Connection );
$rs = new COM( ADODB.Recordset );
$conn-Provider = 'SQLOLEDB';
$conn-Open( Server=wincubix;Uid=oebb;Pwd=oebb;Database=cubix );
$conn-Execute('SET DATEFORMAT ymd');
$rs-ActiveConnection = $conn;
$rs-Open(SELECT DISTINCT * FROM news WHERE gueltig_von = '2002-05-13');

echo 'table';
while (!$rs-EOF) {
echo 'tr';
for ($i=0; $i  $rs-Fields-Count; $i++) {
   echo 'td';
echo $rs-Fields[$i]-Value;
   echo '/td';
}
echo '/tr';
$rs-MoveNext();
}
echo '/table';

$rs-Close();
$rs-Open(SELECT DISTINCT * FROM news WHERE gueltig_von = '2002-05-13');

$rs-Close();
$rs-Open(SELECT DISTINCT * FROM news WHERE gueltig_von = '2002-05-13');

$rs2 = new COM( ADODB.Recordset );
$rs2-ActiveConnection = $conn;
$rs2-Open( SELECT DISTINCT * FROM news WHERE gueltig_von = 
'2002-05-13');


?

-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972 




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: wired things with ADO (OLEDB)

2002-05-13 Thread Michael Bretterklieber

Hi,

first: It is not allowed in ADO to use one connection with more the one 
Recordsets (Design-Problem)

second: this script lets php crash

$conn = new COM( ADODB.Connection );
$conn-Provider = 'SQLOLEDB';
$conn-Open( Server=wincubix;Uid=oebb;Pwd=oebb;Database=cubix );
$conn-Execute('SET DATEFORMAT ymd');
$rs = new COM( ADODB.Recordset );
$rs-ActiveConnection = $conn;
$rs-Open(SELECT DISTINCT * FROM news WHERE gueltig_von = '2002-05-13');

changing the script like this will prevent the AV
//$rs-ActiveConnection = $conn;
$rs-Open(SELECT DISTINCT * FROM news WHERE gueltig_von = 
'2002-05-13', $conn);

I'm using the latest MSDAC (2.7) and the latest snapshot of php,

bye,

Michael Bretterklieber wrote:

 Hi,

 I have strange problems accessing MSSQL over COM over ADO over OLEDB 
 (SQLOLEDB).
 In the script below produces the last sql-statement the sql-error 
 (MSSQL Errornumber: 242)
 *
  Warning*: Invoke() failed: Ausnahmefehler aufgetreten. *Source* : 
 Microsoft OLE DB Provider for SQL Server *Description* : Bei der 
 Konvertierung eines
  char-Datentyps in einen datetime-Datentyp liegt der datetime-Wert 
 außerhalb des gültigen Bereichs. in *D:\adocrash2.php* on line *38*

 but the statement is correct. If I use the same recordset no problems, 
 but If I use new recordset but with the same Connection, then this 
 error occurs the third time opening a new recordset with the same 
 connection. I also tries to set again (SET DATEFORMAT ymd), but this 
 statement has no effect anymore.

 This seems to be a problem with the COM-Module in PHP,

 bye,

 ?php

 $conn = new COM( ADODB.Connection );
 $rs = new COM( ADODB.Recordset );
 $conn-Provider = 'SQLOLEDB';
 $conn-Open( Server=wincubix;Uid=oebb;Pwd=oebb;Database=cubix );
 $conn-Execute('SET DATEFORMAT ymd');
 $rs-ActiveConnection = $conn;
 $rs-Open(SELECT DISTINCT * FROM news WHERE gueltig_von = 
 '2002-05-13');

 echo 'table';
 while (!$rs-EOF) {
echo 'tr';
for ($i=0; $i  $rs-Fields-Count; $i++) {
   echo 'td';
echo $rs-Fields[$i]-Value;
   echo '/td';
}
echo '/tr';
$rs-MoveNext();
 }
 echo '/table';

 $rs-Close();
 $rs-Open(SELECT DISTINCT * FROM news WHERE gueltig_von = 
 '2002-05-13');

 $rs-Close();
 $rs-Open(SELECT DISTINCT * FROM news WHERE gueltig_von = 
 '2002-05-13');

 $rs2 = new COM( ADODB.Recordset );
 $rs2-ActiveConnection = $conn;
 $rs2-Open( SELECT DISTINCT * FROM news WHERE gueltig_von = 
 '2002-05-13');


 ?


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972 




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Re: Maximum field length with PHP 4.1.2/MSSQL v7 ?

2002-05-10 Thread Michael Bretterklieber

Hi,

now I rewrote my PHP-DB-Module using COM and ADO (OLEDB), it works well, 
the 255 Bytes limitation doesen't exist with this method, but uff it 
takes a lot of memory, after openening the db-connection, the 
php-process increases his memory usage with about 4 MB, this seems to be 
a problem of COM (big overhead). But on the oder hand, if microsoft 
propagates this as the only method to access MS SQL, then its a problem 
of those customers who uses microsoft products.

bye,

Michael Bretterklieber wrote:

 Hi,

 I ran into the same problem, but the problem I have is that I can't 
 switch to TEXT Datatype because MSSQL doesen't support SELECT DISTINCT 
 or GROUP BY on them. The Workaround:

 SELECT CAST (fieldxyz AS TEXT) FROM tabelle abc

 is not useful because we build db-independent apps.

 I tried to recompile the MSSQL-Extension with MSSQL-Server 2000 with 
 Service Pack 2 without success. I also changed the define DBMAXCHAR in 
 the file
 Programme/Microsoft SQL Server/80/Tools/DevTools/Include/sqlfront.h to 
 a higher value, but this does offcourse not affect precompiled libs 
 from Microsoft.

 At the moment I have no idea how to solve this? :-(

 ... but in the Query-Analyzer is a setting where you can define the 
 max data-length returned by a field on the fly, so there must be some 
 settings, or the Query Analyzer doesen't use this db-lib,

 bye,

 Chris Mackenzie wrote:

 Frank M. Kromann wrote:

 Many thanks Frank, changing from varchar to text did indeed fix the
 problem.
 On reflection, I do now remember reading about this on another mailing
 list, it's a pitty my memory failed me when I needed it the most :-)

 The tool used to build the MSSQL extension for PHP (DB Library from 
 Microsoft) was created for  SQL Server 6.x and not updated with the 
 release of 7.x or 2000.

 In version 6.x the max length of char and varchar columns was 255 
 bytes, and that is what you are seeing when you try to select data 
 from char, nchar, varchar or nvarchar  columns defined to be longar 
 than 255 bytes. If you use the TEXT type you will not have this 
 limitation.

 - Frank

 Hi All,

 I've come across an interesting problem. I'm trying to retrieve some
 text data (in this case a question up to 400 chars), but each time I
 perform a select statement I only receive the first 255 chars.

 What's the go here, is this just another microsoft thing ?


 -- 
 Rgds,
 Chris MacKenzie

 Windows: Where do you want to go today ?
 Mac OS: Where do you want to be tomorrow ?
  Linux: Are you coming or what ?





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Maximum field length with PHP 4.1.2/MSSQL v7 ?

2002-05-07 Thread Michael Bretterklieber

Hi,

I ran into the same problem, but the problem I have is that I can't 
switch to TEXT Datatype because MSSQL doesen't support SELECT DISTINCT 
or GROUP BY on them. The Workaround:

SELECT CAST (fieldxyz AS TEXT) FROM tabelle abc

is not useful because we build db-independent apps.

I tried to recompile the MSSQL-Extension with MSSQL-Server 2000 with 
Service Pack 2 without success. I also changed the define DBMAXCHAR in 
the file
Programme/Microsoft SQL Server/80/Tools/DevTools/Include/sqlfront.h to a 
higher value, but this does offcourse not affect precompiled libs from 
Microsoft.

At the moment I have no idea how to solve this? :-(

... but in the Query-Analyzer is a setting where you can define the max 
data-length returned by a field on the fly, so there must be some 
settings, or the Query Analyzer doesen't use this db-lib,

bye,

Chris Mackenzie wrote:

Frank M. Kromann wrote:

Many thanks Frank, changing from varchar to text did indeed fix the
problem.
On reflection, I do now remember reading about this on another mailing
list, it's a pitty my memory failed me when I needed it the most :-)

The tool used to build the MSSQL extension for PHP (DB Library from Microsoft) was 
created for  SQL Server 6.x and not updated with the release of 7.x or 2000.

In version 6.x the max length of char and varchar columns was 255 bytes, and that is 
what you are seeing when you try to select data from char, nchar, varchar or nvarchar 
 columns defined to be longar than 255 bytes. If you use the TEXT type you will not 
have this limitation.

- Frank

Hi All,

I've come across an interesting problem. I'm trying to retrieve some
text data (in this case a question up to 400 chars), but each time I
perform a select statement I only receive the first 255 chars.

What's the go here, is this just another microsoft thing ?


--
Rgds,
Chris MacKenzie

Windows: Where do you want to go today ?
 Mac OS: Where do you want to be tomorrow ?
  Linux: Are you coming or what ?


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972 




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php