I found the problem.I was missing the "TEMPORARY" word in my query.The code 
below fixes my issue:session.Database.Execute(info.SqlInsertString + " 
TEMPORARY", record);
----------------------------------------
> From: d_vandenbr...@live.com
> To: wix-users@lists.sourceforge.net
> Date: Fri, 18 Mar 2011 11:37:00 +0100
> Subject: [WiX-users] Database Update
>
>
> Hi guys,
>
>
> I’m
> creating a custom action which tries to insert a row in the IniFile table.
>
>
> When
> executing this code, an exception occurs:
>
> TableInfo info =
> session.Database.Tables["IniFile"];
>
> Record record
> =
> session.Database.CreateRecord(info.Columns.Count);
>
> record.FormatString = info.Columns.FormatString;
>
> record.SetString(1, "Initest");//IniFile
>
> record.SetString(2, "test.ini");//FileName
>
> record.SetString(3, "INSTALLLOCATION");//DirProperty
>
> record.SetString(4, "section");//DirProperty
>
> record.SetString(5, "keytest");//Key
>
> record.SetString(6, "value");//Value
>
> record.SetInteger(7, 0); //Action
>
> record.SetString(8, "Component.exe");//Component_
>
>
>
> try
>
> {
>
> session.Database.Execute(info.SqlInsertString, record);
>
> }
>
> catch (Exception ex)
>
> {
>
> session.Log(ex.Message);
>
> throw;
>
> }
>
>
> 1627 -
> Function failed during execution Database:
> Table(s) Update failed.
>
>
>
> at Microsoft.Deployment.WindowsInstaller.View.Execute(Record
> executeParams)
>
> at
> Microsoft.Deployment.WindowsInstaller.Database.Execute(String sql, Record
> record)
>
> at Custom.CustomActions.IniFileTest(Session
> session)
>
>
> The info.SqlInsertString
> retuns “INSERT INTO `IniFile` (`IniFile`, `FileName`, `DirProperty`, 
> `Section`,
> `Key`, `Value`, `Action`, `Component_`) VALUES (?, ?, ?, ?, ?, ?, ?, ?)”.
>
> The format
> string is: IniFile = [1], FileName = [2], DirProperty = [3], Section = [4], 
> Key
> = [5], Value = [6], Action = [7], Component_ = [8]
>
>
> Am I doing
> something wrong here?
>
>
>
> Regards,
>
>
> DvdBrink
> ------------------------------------------------------------------------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
                                          
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to