|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-11-20 07:01 UTC] andrew dot stopford at btinternet dot com
[2001-11-20 07:06 UTC] derick@php.net
[2001-11-20 07:37 UTC] andrew dot stopford at btinternet dot com
[2001-11-20 07:39 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 09:00:01 2025 UTC |
Dear Sirs, When using Microsoft Active Data Objects in PHP I have come across a problem. The ADO Recordset insert record function fails with a Invoke Error message if the SQL Server 2000 table contains fields with User Defined Types. If the table does not contain UDT then the function works fine and inserts a record into the table. I have tested the same script using VBscript/ASP and did not get this error. The sample script is below <?php $objcon = new COM("ADODB.Connection"); $dbcon = "DSN=mydb;UID=sa;PWD=;"; $objcon->Open($dbcon); $objrs = new COM("ADODB.Recordset"); $objrs->CursorLocation = 2; $objrs->CursorType = 0; $objrs->LockType = 3; $sqlquery = "SELECT * FROM MyTable"; $objrs->Open($sqlquery, $objcon); //this fais if table contains UDT fields $objrs->AddNew(); $test1 = $objrs->Fields(0); $test1->value = "Some Data"; $objrs->Update(); $objrs->Requery(); $objrs->Close(); $objcon->close(); ?> Many thanks Andrew Stopford