#1  
Old 27th May 2013, 01:43 AM
Micael Micael is offline
Member
 
Join Date: Mar 2011
Posts: 78
Default Cant update record again

Was her som time ago an had the same trubbel I learnd then how to do it but now it's not working

I have a smal nexus test dabase with 2 fields
Intfield and StrField
Everything is setup fine and I have no problems with reading from the database


Here is the code

<?php
require_once("rpcl/rpcl.inc.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");
use_unit("dbtables.inc.php");

//Class definition
class Page1 extends Page
{
public $UpdateUsingQuery1_Btn = null;
public $Database1 = null;
public $UpdateUsingTable1_Btn = null;
public $Table1 = null;
public $Query1 = null;
function UpdateUsingTable1_BtnClick($sender, $params)
{
$this->Table1->Active = false;
$this->Table1->Filter = "Intfield = 10";
$this->Table1->Active = true;

$this->Table1->edit();
$this->Table1->fieldset('StrField', 'Johan');
$this->Table1->post();
// at post I get the following message
// Application raised an exception class PDOException with message
// 'SQLSTATE[H]: <>: 1 NexusDB: : Query execution failed:
// Type mismatch: The source value type (NATIONAL CHARACTER VARYING)
// and the target site type (column: Intfield, [INTEGER]) are not assignment
// compatible

}

function UpdateUsingQuery1_BtnClick($sender, $params)
{
$this->Query1->Active = FALSE;
$this->Query1->SQL = "UPDATE Test SET StrField = 'Johan' WHERE Intfield = 10";
$this->Query1->Active = TRUE;
// here the error message are
// Application raised an exception class PDOException with message
// 'SQLSTATE[H]: <>: 1 Cannot perform this operation on a closed dataset'

}
}

global $application;

global $Page1;

//Creates the form
$Page1=new Page1($application);

//Read from resource file
$Page1->loadResource(__FILE__);

//Shows the form
$Page1->show();

?>
  #2  
Old 27th May 2013, 12:12 PM
Eivind Bakkestuen [NDD]
 
Posts: n/a
Default Re: Cant update record again

> $this->Table1->fieldset('StrField', 'Johan');

I can't find "fieldset" in the HTML5 builder docs. It seems they use
persistent field objects, like in this example?

http://blogs.embarcadero.com/jaruzaf...html5-builder/


--
Eivind Bakkestuen [NDD]
  #3  
Old 3rd June 2013, 11:25 PM
Micael Micael is offline
Member
 
Join Date: Mar 2011
Posts: 78
Default

I have now tried a little more and exactly the same code works perfect when I switch database to MySql, But I would like it to work with my nexusDB

Please help me
micael


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
record lock John nexusdb.public.support 2 10th February 2012 08:43 AM
Getting the last record in a subquery David Guest nexusdb.public.support.sql 3 17th November 2008 11:25 PM
Self-referencing DB. How to tell if a record is a parent of another record? Jerry Hayes nexusdb.public.support.sql 10 22nd December 2007 06:29 AM
Record Engine PK nexusdb.public.support 3 2nd April 2007 05:17 PM
Update Record Colling J.P. nexusdb.public.discussions 11 26th August 2003 05:01 PM


All times are GMT +11. The time now is 06:45 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.