Denis Grannell | 3 Nov 2005 19:26
Picon

Re: Just installed 4.66 and not making any progress

Hi Folks,

I've got my connection working now - I used the
following code suggested by Alfredo Yong. 

$ADODB['adodb_path']= 'adodb';
$ADODB['host'] = 'host_name_or_ip';
$ADODB['user'] = 'my userid';
$ADODB['password'] = 'my password';
$ADODB['database_type'] = 'postgres';
$ADODB['database_name'] = 'my database name'; 
include("{$ADODB['adodb_path']}/adodb.inc.php");

$db = NewADOConnection($ADODB['database_type']);
$db->Connect($ADODB['host'], $ADODB['my userid'], $ADODB['my password'],
$ADODB['my database_name']);

I must have had  a type somewhere in the code
at the start, but it's OK now.

Many thanks to everyone that replied.

cheers,
Denis

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
(Continue reading)

Daniel Kern | 8 Nov 2005 10:44

Caching question

Hi,
Can the ADOdb be used only for caching and not for DB abstraction? Is
so, is it simple to do so, or is it an "unnatural" way of using this
library?

Thanks in advance. 

daniel <at> kayote.com

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
Diego Juritz | 8 Nov 2005 13:16

AutoExecute() with Oracle's CLOBS

Hi!
 
Does anyone uses AutoExecute() feature?
It's very interesting, it allows you to pass an array of values, table name, and 'INSERT' or 'UPDATE' keyword whether you want to make an insert or update.
The problem is that when you need to make a query (insert or update) into a Clob field, longer than 4000 characters it doesn't work, because for that cases, you have to use UpdateClob() method.
Why don't they work together?
I mean, if a make an AutoExecute() with a field longer than 4000 chars, ADODB should realise and use an UpdateClob() internally.
 
Thanks!
   Diego.-
Martin Sarsale | 15 Nov 2005 16:33

autoexecute and clobs in oracle

Dear all:

Are you planning to add support to AutoExecute for inserting/updating 
CLOBS/BLOBS under Oracle?

Thanks in advance

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
Matt Fletcher | 18 Nov 2005 04:18
Picon

MS Access Update Error

I have been trying to use the following code to update a membership 
management tool I have been writing. I am having problems with the 
GetUpdateSQL() part though. Below is the entire code of the PHP page, 
and below that is the output.

<!-- DEBUG -->
<pre><?php print_r($_POST) ; ?></pre>

<?php
# INCLUDE DATABASE CONNECTION FUNCTIONS AND CONFIGURATION DATA
include('config.php');
include('db.php');

# STRIP EMPTY FORM FIELDS
foreach($_POST as $key=>$post) {
if ($post == '') unset($_POST[$key]);
}

# HANDLE NEW ENTRIES
if ($_POST['doctor_id'] == '') {
# SAVE ENTRY
if (!$db->AutoExecute('doctors',$_POST,'INSERT')) echo $db->ErrorMsg();
}

# HANDLE EDITED ENTRIES
else {
# GET ENTRY
$doctor = $db->Execute("SELECT * FROM doctors WHERE doctor_id = 
".$_POST['doctor_id']);

# GET UPDATE SQL
echo $db->GetUpdateSQL(&$doctor, $_POST);

# DEBUG
echo $sql.'<br /><br />';

# SAVE ENTRY
if (!$db->Execute($sql)) echo $db->ErrorMsg();

}
# HEADER
?>

Array
(
[doctor_name] => Dr Chris Evans
[fk_doctor_address] => 1002
[fk_doctor_telephone] => 526
[doctor_id] => 5
)
UPDATE doctors SET DOCTOR_NAME='Dr Chris Evans' WHERE doctor_id = 5

[Microsoft][ODBC Microsoft Access Driver]Invalid use of null pointer

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
Izaak Branderhorst | 18 Nov 2005 17:55
Picon
Favicon

partial indexes?

Hi there,

I've scoured the documentation for anything about partial index support -  
for example, to index only the first 5 characters of a 128 byte varchar  
column. I understand that this is probably not widely supported between  
databases, but it would be nice if I could use it for at least MySQL.  
Also, what happens if you index a blob column? The result would be  
different depending on the database? Indexing anything too large would be  
pointless in MySQL, for my purposes...

Izaak

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
tmp | 23 Nov 2005 17:24
Picon

Autocommit bug for postgresql?

Have anybody got autocommit=false to work with the postgresql driver?
All updates/inserts are currently automatically committed even though
autocommit=false.

Is this a well known bug or how do I make it work?

Example:
 <?php
   ...[some setup code]...
   $conn->Execute("insert into myTable values(1)");
   $conn->CommitTrans(); // or similar
   $conn->Execute("insert into myTable values(2)");
 ?>

In the above code snip only the value "1" should be committed with
autocommit=false but currently both statements are committed - which is
wrong.

What to do?

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Picon

RES: Autocommit bug for postgresql? (tmp)

Hi :

Try this code.

<?php
  ...[some setup code]...
  $conn->StartTrans();

  $rs = $conn->Execute( "insert into myTable values(1)" );

  if ( !$rs )
  {
	exit('Error : ' . $conn->ErrorMsg());
	$conn->CompleteTrans( false );
  }

  $conn->CompleteTrans(true); // or similar

  $conn->Execute("insert into myTable values(2)");
 ?>

Alejandro Michelin Salomon
Porto Alegre
Brasil

> Message: 2
> From: tmp <skrald <at> amossen.dk>
> To: adodb-general <at> lists.sourceforge.net 
> Date: Wed, 23 Nov 2005 17:24:32 +0100
> Subject: [ADodb-general] Autocommit bug for postgresql?
> 
> Have anybody got autocommit=false to work with the postgresql 
> driver? All updates/inserts are currently automatically 
> committed even though autocommit=false.
> 
> Is this a well known bug or how do I make it work?
> 
> Example:
>  <?php
>    ...[some setup code]...
>    $conn->Execute("insert into myTable values(1)");
>    $conn->CommitTrans(); // or similar
>    $conn->Execute("insert into myTable values(2)");
>  ?>
> 
> In the above code snip only the value "1" should be committed 
> with autocommit=false but currently both statements are 
> committed - which is wrong.
> 
> What to do?
> 
> 
> 
> 
> --__--__--
> 
> _______________________________________________
> ADodb-general mailing list
> ADodb-general <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/adodb-general
> 
> 
> End of ADodb-general Digest
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.13.7/181 - Release 
> Date: 24/11/2005
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.13.7/181 - Release 
> Date: 24/11/2005
>  
> 

--

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/181 - Release Date: 24/11/2005

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Alfredo Yong | 24 Nov 2005 15:15
Picon

Re: RES: Autocommit bug for postgresql? (tmp)

yeah, but the trick here is, being autocommit false, no commit should be done unless specifically stated. In your code you are executing an explicit rollback ($conn->CompleteTrans( false )).
 
A possible explanation is: in skrald <at> amossen code,  even assuming that a transaction has been initiated before sentence 1, certanily no transaction has been initiated before sentence 2;  so, autocommit false is not really active (see BeginTrans() in the manual: it turns off autoCommit). Please give it a try and tell us what happened.
 
There is also a final note in the BeginTrans() section of the manual: "Some buggy database extensions are known to commit all outstanding tranasactions, so you might want to explicitly do a $DB->RollbackTrans() in your error handler for safety."
 
Anyway, I like to use Smart Transactions with  $conn->StartTrans () and $conn->CompleteTrans(); It works for me. 
greetings,

 
On 11/24/05, Alejandro Michelin Salomon ( X-Sistemas ) <amichelin <at> x-sistemas.com.br> wrote:
Hi :

Try this code.

<?php
...[some setup code]...
$conn->StartTrans();

$rs = $conn->Execute( "insert into myTable values(1)" );

if ( !$rs )
{
       exit('Error : ' . $conn->ErrorMsg());
       $conn->CompleteTrans( false );
}

$conn->CompleteTrans(true); // or similar

$conn->Execute("insert into myTable values(2)");
?>

Alejandro Michelin Salomon
Porto Alegre
Brasil



> Message: 2
> From: tmp <skrald <at> amossen.dk>
> To: adodb-general <at> lists.sourceforge.net
> Date: Wed, 23 Nov 2005 17:24:32 +0100
> Subject: [ADodb-general] Autocommit bug for postgresql?
>
> Have anybody got autocommit=false to work with the postgresql
> driver? All updates/inserts are currently automatically
> committed even though autocommit=false.
>
> Is this a well known bug or how do I make it work?
>
> Example:
>  <?php
>    ...[some setup code]...
>    $conn->Execute("insert into myTable values(1)");
>    $conn->CommitTrans(); // or similar
>    $conn->Execute("insert into myTable values(2)");
>  ?>
>
> In the above code snip only the value "1" should be committed
> with autocommit=false but currently both statements are
> committed - which is wrong.
>
> What to do?
>
>
>
>
> --__--__--
>
> _______________________________________________
> ADodb-general mailing list
> ADodb-general <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/adodb-general
>
>
> End of ADodb-general Digest
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.13.7/181 - Release
> Date: 24/11/2005
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.13.7/181 - Release
> Date: 24/11/2005
>
>

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/181 - Release Date: 24/11/2005




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
ADodb-general mailing list
ADodb-general <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/adodb-general



--
Alfredo Yong
Sistemas web
tmp | 26 Nov 2005 02:03
Picon

Re: RES: Autocommit bug for postgresql? (tmp)


> A possible explanation is: in skrald <at> amossen code,  even assuming that
> a transaction has been initiated before sentence 1, certanily no 
> transaction has been initiated before sentence 2;  so, autocommit 
> false is not really active (see BeginTrans() in the manual: it turns 
> off autoCommit). Please give it a try and tell us what happened.

Yes, BeginTrans() turns off autocommit. But in case of a rollback or an
error I explicitly have to state a BeginTrans() again. Also, after each
commit, BeginTrans() has to be stated again to turn off autocommit for a
second transaction.
I search for a way to avoid the need for these explicit BeginTrans()
statements. In pear::db (pear.php.net), turning off autocommit really
turns off autocommit. Completely. For good. And without the need for a
re-turn-off after each commit/rollback/error.
Can a similar behavior be achieved in adodb?

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

Gmane