dcsimg
Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 51

Thread: Tornado-Need two ways Update records

  1. #31
    Join Date
    Oct 2002
    Posts
    933
    did I send you the dll already ?

    FK

  2. #32
    Join Date
    Dec 2002
    Location
    Albany, NY
    Posts
    115
    No, but I've been waiting to hear from you regarding it....

  3. #33
    Join Date
    Oct 2002
    Posts
    933
    OK.. try again... let me know when you get it...

  4. #34
    Join Date
    Dec 2002
    Location
    Albany, NY
    Posts
    115
    OK, Frank, I have the latest tornado.dll. Now I need the function name and syntax to use it...

  5. #35
    Join Date
    Oct 2002
    Posts
    933
    should be the same as gridupadteflds. just change the update to add.

    <script language="VB" runat="server">
    Sub Page_Load(Src As Object, E As EventArgs)
    Dim X As New tornado.z()
    X.dbQP = "U=1|S=15|D=Nwind|ni=b5,update,gridupdate,add,grid add|Q=Orders|Th=Title=Grid Edit| bm=orders;0+1|gdf=0,3,4,5,7"
    X.dbEditUpdateFlds = "fi=0|type=RONOUPDATE,4,5,7"
    X.dbEditGridUpdateFlds = "fi=0|type=RONOUPDATE,5,7"
    X.dbEditAddFlds = "0,4,5,7"
    X.dbEditGridAddFlds = "fi=0,5"
    X.dbDebug = "EditAction"
    X.ASPdbNET()
    End Sub
    </script>


    FK

  6. #36
    Join Date
    Dec 2002
    Location
    Albany, NY
    Posts
    115
    Frank,

    Here's the error I'm getting:
    Compiler Error Message: BC30456: 'dbEditGridAddFlds' is not a member of 'Tornado.z'.

    Looks like I do not have the latest Tornado.dll.

    The version as reported by TornadoInfo is: ver 4.4.30.11

  7. #37
    Join Date
    Oct 2002
    Posts
    933
    I looked into the latest normal and grid edit implementation and it really needs the corresponding user defeined edit SQL to go with the two modes. Otherwsie, the fields edited in the two modes mustbe the same in which is too restrictive. OK.. now it is done and I'll send you the DLL and test code (bottom of Edit manual page). Confirm the new dbEditGridUPdateSQL and dbEditGridAddSQL for me...


    Frank

  8. #38
    Join Date
    Dec 2002
    Location
    Albany, NY
    Posts
    115
    Frank,

    Wow! The SQL functions are done, thanks. I'm just back from visiting clients in Michigan and will get to testing the new SQL functions today.

    Did you get a chance to post the syntax needed to save data to multiple files?

    talk to you later... Paul

  9. #39
    Join Date
    Oct 2002
    Posts
    933
    I added the example to the end of the edit manual page - edit two tables.

    Frank

  10. #40
    Join Date
    Dec 2002
    Location
    Albany, NY
    Posts
    115
    Frank,

    Is the new file posted to the FTP site we used last time? Paul

  11. #41
    Join Date
    Oct 2002
    Posts
    933
    OH.. I just did that.. I cannot delete the old dll file (access denied) but I did upload the newest dll and hope that it'll overwrite the old one.

    let me know..

    Frank

  12. #42
    Join Date
    Dec 2002
    Location
    Albany, NY
    Posts
    115
    Frank,

    I downloaded the new .dll from the FTP site. Thank you. I'll test out the new functions as soon as I get the multi-table edit/add working.

    Having looked at your example I don't see what I'm doing wrong. Here's the error the system is giving.

    System.Data.OleDb.OleDbException: Invalid column name 'LocPin'. at System.Data.OleDb.OleDbDataReader.NextResults(IMul tipleResults imultipleResults, OleDbConnection connection, OleDbCommand command) at System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at Tornado.RS_OleDB.Execute_SQLs(String which, String sql, Int32 recs, Int64& LRecs)

    (313 : 7) Error



    Edit SQL = INSERT INTO mpoProject (MPOPin,MPOName,mpoNameCode,CreatedDate,FedYear,Co unty,mpoAgency,ObligateDate,AirQuality,IsActive,On StateSystem,Safety,Remarks,LocPin,ProjectBegin,Pro jectEnd,MilePostBegin,MilePostEnd,Distance,PolDist Code,Sponsor,GISData) VALUES ('111999','UCTC','1','6/21/2004','2004','Ulster','City',Null,'AQ Exempt','False','False','False',Null,'111999',Null ,Null,Null,Null,Null,Null,Null,Null)

    And, here's my code:

    DIM addSql as string = ""
    addSql = "INSERT INTO mpoProject (mpoProject.mpoPin"
    addSql = addSql & "mpoProject.DOTAuth,mpoProject.mpoName,"
    addSql = addSql & "mpoProject.WorkType,mpoProject.IsActive,"
    addSql = addSql & "mpoProject.Safety,mpoProject.FunctionClass,"
    addSql = addSql & "mpoProject.OnStateSystem,mpoProject.Let_Date, "
    addSql = addSql & "mpoProject.County,mpoProject.AirQuality,"
    addSql = addSql & "mpoProject.ProjectManager,mpoProject.mpoAgenc y,"
    addSql = addSql & "mpoProject.FedYear,mpoProject.CreatedBy,"
    addSql = addSql & "mpoProject.UpDatedBy,mpoProject.CreatedDate,"
    addSql = addSql & "mpoProject.UpDatedDate,mpoProject.mpoNameCode ,"
    addSql = addSql & "mpoProject.Sponsor,mpoProject.AirQuality,"
    addSql = addSql & "mpoProject.Remarks,mpoProject.Description)"
    addSql = addSql & "VALUES ('mpoPin','DOTAuth','mpoName','WorkType','IsActive ',"
    addSql = addSql & "'Safety','FunctionClass','OnStateSystem',#Let_Dat e#,'FedYear'"
    addSql = addSql & "'CreatedBy','UpDatedBy',#CreateDate#,#UpdateDate# ,"
    addSql = addSql & "'mpoNameCode','Sponsor',"
    addSql = addSql & "'AirQuality','Remarks','Description');"
    addSql = addSql & "INSERT INTO ProjectLocation "
    addSql = addSql & "(ProjectLocation.LocPin,ProjectLocation.Location, "
    addSql = addSql & "ProjectLocation.Distance,ProjectLocation.MilePost Begin,"
    addSql = addSql & "ProjectLocation.MilePostEnd,ProjectLocation.Map_N umber,"
    addSql = addSql & "ProjectLocation.CountyName,ProjectLocation.Corrid or,"
    addSql = addSql & "ProjectLocation.ProjectBegin,ProjectLocation.Proj ectEnd,"
    addSql = addSql & "ProjectLocation.PolDistCode,ProjectLocation.GISDa ta)"
    addSql = addSql & "VALUES ('LocPin','Location','Distance','MilePostBegin','M ilePostEnd',"
    addSql = addSql & "'Map_Number','CountyName','Corridor','ProjectBegi n','ProjectEnd',"
    addSql = addSql & "'PolDistCode','GISDate')"
    .dbEditAddSQL = addSql


    I can't say for sure but the SQL Debug does not contain 2 INSERT INTO statements, which are present in the .dbEditAddSQL function. It would seem to me 2 INSERT INTO statements should be there, to differentiate between the 2 tables.

    Have tried every trick I know, Some help would be greatly appreciated.

    Paul

  13. #43
    Join Date
    Oct 2002
    Posts
    933
    did you try the example in the manual page (as follows)?


    <script language='vb' runat='server'>
    Sub Page_Load(Source as Object, E as EventArgs)
    Dim SQL As String = "SELECT Addresses.ID, Addresses.Address, FLname.LastName, FLname.FirstName FROM Addresses"
    SQL &= " INNER JOIN FLname ON Addresses.ID = FLname.ID ORDER BY Addresses.ID"

    Dim AddSQL As String = "(|INSERT INTO FLname (ID, LastName, FirstName) VALUES ('[[0]]', '[[2]]', '[[3]]');"
    AddSQL &= "INSERT INTO Addresses (ID, Address) VALUES ('[[0]]', '[[1]]')"

    Dim UpSQL As String = "(|UPDATE FLname SET LastName='[[2]]', FirstName='[[3]]' WHERE ID='{{0}}';"
    UpSQL &= "UPDATE Addresses SET Address='[[1]]' WHERE ID='{{0}}'"

    Dim X As New tornado.z()
    X.dbQP = "U=1|M=Grid!RowEdit=true|D=MultipleEdit|NI=b5,add, update|PS=-1|TH=Ti= 2 Tables
    X.dbSQL = SQL
    X.dbDebug = "ActiveSQL, EditAction, EditSetup"
    X.dbNameMap = "fi=0|Al=ID|Fo=Addresses.ID, fi=1|Al=Address|Fo=Addresses.address, fi=2|Al=First|Fo=FLname.firstname,fi=3|Al=Last|Fo= FLname.lastname"
    X.dbEditAddFlds = "0,1,2,3"
    X.dbEditUpdateFlds = "0,1,2,3"
    X.dbEditUPDATESQL = UpSQL
    X.dbEditADDSQL = AddSQL
    X.dbBookMark = "FLname;0"
    X.ASPdbNET()
    End Sub
    </script>

  14. #44
    Join Date
    Dec 2002
    Location
    Albany, NY
    Posts
    115
    Yes, I did. And I don't see how that code will work either. Here's the error it produces.

    Format of the initialization string does not conform to specification starting at index 0.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.

    Source Error:


    Line 20: X.dbEditADDSQL = AddSQL
    Line 21: X.dbBookMark = "FLname;0"
    Line 22: X.ASPdbNET()
    Line 23: End Sub
    Line 24: </script>

    Whatever, this means....
    Also, to what database do the tables FLName and Address belong. Maybe you should send to me, too. I know saving to multi tables works with aspDB Classic because I was there and did that. Did you look at the debug SQL string I posted? Should that string have 2 INSERT INTO statements? The behavior seems to indicate that the first data element of the second table
    (ProectLocation)is unknown. Strange, it's present in the SQL statement! What do you think?

  15. #45
    Join Date
    Oct 2002
    Posts
    933
    did you check out the special example - edit two tables section in the Edit manual page. I tried that and works OK.

    Frank

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •