Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Designer> Problem trying to insert into a MS Access 2003 Query
 

Pages: 1
Designer
Problem trying to insert into a MS Access 2003 Query
Page:1/1 

  Print all messages in this thread  
Poster Message
like2175
User



Location:
Camberley, United Kingdom
Joined on:
27-Mar-2006 16:16:06
Posted:
83 posts
# Posted on: 02-Mar-2009 12:56:52.  
I have an updateable query in an MS Access 2003 database . I can edit existing records successfully using an LLBLGenProDataSource and a ListView on my aspx page . However, when I try to insert to this query via the same LLBLGenProDataSource I get:

Quote:

ORMQueryExecutionException was unhandled by user code

An exception was caught during the execution of an action query: Operation must use an updateable query.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.


at

Code:
        ''' <summary>Performs the insert action of a new Entity to the persistent storage.</summary>
        ''' <returns>true if succeeded, False otherwise</returns>
        Protected Overrides Overloads Function InsertEntity() As Boolean
            Dim dao As TurbineFullVDAO = CType(CreateDAOInstance(), TurbineFullVDAO)
            Return dao.AddNew(MyBase.Fields, MyBase.Transaction)
        End Function

The query is:
Quote:
Query: INSERT INTO [TURBINE_FULL_V] ([TURBINE_TITLE], [TURBINE_DESCR], [NOTES], [MONOPOLE_STATUS_ID], [TRANS_PIECE_STATUS_ID], [WIND_TURBINE_STATUS_ID], [JTUBE_STATUS_ID], [MS_LAST_UPDATE], [MS_LAST_UPDATE_BY], [TP_LAST_UPDATE], [TP_LAST_UPDATE_BY], [WT_LAST_UPDATE], [WT_LAST_UPDATE_BY], [JT_LAST_UPDATE], [JT_LAST_UPDATE_BY], [LAST_UPDATE], [LAST_UPDATE_BY]) VALUES (@TurbineTitle, @TurbineDescr, @Notes, @MonopoleStatusId, @TransPieceStatusId, @WindTurbineStatusId, @JtubeStatusId, @MsLastUpdate, @MsLastUpdateBy, @TpLastUpdate, @TpLastUpdateBy, @WtLastUpdate, @WtLastUpdateBy, @JtLastUpdate, @JtLastUpdateBy, @LastUpdate, @LastUpdateBy)     Parameter: @TurbineTitle : String. Length: 50. Precision: 0. Scale: 0. Direction: Input. Value: "jjjjj".     Parameter: @TurbineDescr : String. Length: 50. Precision: 0. Scale: 0. Direction: Input. Value: <undefined value>.     Parameter: @Notes : String. Length: 254. Precision: 0. Scale: 0. Direction: Input. Value: <undefined value>.     Parameter: @MonopoleStatusId : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 2.     Parameter: @TransPieceStatusId : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 1.     Parameter: @WindTurbineStatusId : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 1.     Parameter: @JtubeStatusId : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 1.     Parameter: @MsLastUpdate : DateTime. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 02/03/2009 11:49:53.     Parameter: @MsLastUpdateBy : String. Length: 20. Precision: 0. Scale: 0. Direction: Input. Value: "lik25827".     Parameter: @TpLastUpdate : DateTime. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 02/03/2009 11:49:53.     Parameter: @TpLastUpdateBy : String. Length: 20. Precision: 0. Scale: 0. Direction: Input. Value: "lik25827".     Parameter: @WtLastUpdate : DateTime. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 02/03/2009 11:49:53.     Parameter: @WtLastUpdateBy : String. Length: 20. Precision: 0. Scale: 0. Direction: Input. Value: "lik25827".     Parameter: @JtLastUpdate : DateTime. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 02/03/2009 11:49:53.     Parameter: @JtLastUpdateBy : String. Length: 20. Precision: 0. Scale: 0. Direction: Input. Value: "lik25827".     Parameter: @LastUpdate : DateTime. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 02/03/2009 11:49:53.     Parameter: @LastUpdateBy : String. Length: 20. Precision: 0. Scale: 0. Direction: Input. Value: "lik25827". "


Am I missing something obvious?

I'm using v2.6.0 which I downloaded last Thursday and VS 2008
  Top
like2175
User



Location:
Camberley, United Kingdom
Joined on:
27-Mar-2006 16:16:06
Posted:
83 posts
# Posted on: 02-Mar-2009 13:27:52.  
Sorted!

I updated my SQL from
Code:
SELECT TU.TURBINE_ID, TU.TURBINE_TITLE, TU.TURBINE_DESCR, TU.NOTES, TU.MONOPOLE_STATUS_ID, MO.MONOPOLE_STATUS, TU.TRANS_PIECE_STATUS_ID, TR.TRANS_PIECE_STATUS, TU.WIND_TURBINE_STATUS_ID, WI.WIND_TURBINE_STATUS, TU.JTUBE_STATUS_ID, JT.JTUBE_STATUS, TU.MS_LAST_UPDATE, TU.MS_LAST_UPDATE_BY, TU.TP_LAST_UPDATE, TU.TP_LAST_UPDATE_BY, TU.WT_LAST_UPDATE, TU.WT_LAST_UPDATE_BY, TU.JT_LAST_UPDATE, TU.JT_LAST_UPDATE_BY, TU.LAST_UPDATE, TU.LAST_UPDATE_BY
FROM JTUBE_STATUS AS JT, WIND_TURBINE_STATUS AS WI, TRANS_PIECE_STATUS AS TR, MONOPOLE_STATUS AS MO, TURBINE AS TU
WHERE (((TU.MONOPOLE_STATUS_ID)=[MO].[MONOPOLE_STATUS_ID]) AND ((TU.TRANS_PIECE_STATUS_ID)=[TR].[TRANS_PIECE_STATUS_ID]) AND ((TU.WIND_TURBINE_STATUS_ID)=[WI].[WIND_TURBINE_STATUS_ID]) AND ((TU.JTUBE_STATUS_ID)=[JT].[JTUBE_STATUS_ID]));


To

Code:
SELECT TU.TURBINE_ID, TU.TURBINE_TITLE, TU.TURBINE_DESCR, TU.NOTES, TU.MONOPOLE_STATUS_ID, MO.MONOPOLE_STATUS, TU.TRANS_PIECE_STATUS_ID, TR.TRANS_PIECE_STATUS, TU.WIND_TURBINE_STATUS_ID, WI.WIND_TURBINE_STATUS, TU.JTUBE_STATUS_ID, JT.JTUBE_STATUS, TU.MS_LAST_UPDATE, TU.MS_LAST_UPDATE_BY, TU.TP_LAST_UPDATE, TU.TP_LAST_UPDATE_BY, TU.WT_LAST_UPDATE, TU.WT_LAST_UPDATE_BY, TU.JT_LAST_UPDATE, TU.JT_LAST_UPDATE_BY, TU.LAST_UPDATE, TU.LAST_UPDATE_BY
FROM (((TURBINE AS TU LEFT JOIN MONOPOLE_STATUS AS MO ON TU.MONOPOLE_STATUS_ID=MO.MONOPOLE_STATUS_ID) LEFT JOIN JTUBE_STATUS AS JT ON TU.JTUBE_STATUS_ID=JT.JTUBE_STATUS_ID) LEFT JOIN WIND_TURBINE_STATUS AS WI ON TU.WIND_TURBINE_STATUS_ID=WI.WIND_TURBINE_STATUS_ID) LEFT JOIN TRANS_PIECE_STATUS AS TR ON TU.TRANS_PIECE_STATUS_ID=TR.TRANS_PIECE_STATUS_ID
WHERE (((TU.MONOPOLE_STATUS_ID)=MO.MONOPOLE_STATUS_ID) And ((TU.TRANS_PIECE_STATUS_ID)=TR.TRANS_PIECE_STATUS_ID) And ((TU.WIND_TURBINE_STATUS_ID)=WI.WIND_TURBINE_STATUS_ID) And ((TU.JTUBE_STATUS_ID)=JT.JTUBE_STATUS_ID));


Graham


  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.