Rank: Newbie
Groups: Registered
Joined: 12/8/2015(UTC) Posts: 6 
|
I have problems connecting to an Access database using the same machisms described in the tutoral video "Building a mobile solution with database data from SQL Server". The first problem arises when saving to the Access db using the "save function" at actions for control button1. This functions does not show my Access db at all! The solution can thus not be saved. To bypass this, I implemented a DB execute using following SQL statement:
insert into tabTipCalc IN F:\Lehre\Sem 3\Programmierübungen\MobileTogether\TipCalc_DB.accdb values ( $PERSISTENT/Root/Current/Visit/BillAmount, $PERSISTENT/Root/Current/Visit/TipPercentage, $PERSISTENT/Root/Current/Visit/TipAmount, $PERSISTENT/Root/Current/Visit/TotalAmount, current-date-no-TZ() )
which results in an error message "database syntax error on INSERT statement". Unfortunately, I couldn't find anything useful about this topic in this forum nor in the online help und would be grateful, if anybody can give me some hints to solve the problem. Thank you. Udo
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 9/15/2014(UTC) Posts: 133  Was thanked: 18 time(s) in 18 post(s)
|
Hi Heuser! "Normally", your database page source (e.g. "$DB1") should be listed in the "Save" action, but there are options, where this is not possible (e.g. if you use advanced SELECT statements with JOINs,...). Would it be possible to attach your design file here or send it to Altova support? Then we can look into it in detail, why default saving might not be possible in your case or how you can change the sample to make it work. Reg. the insert statement: AFAIK spaces are not allowed in the DB path (as you have it between "Sem" and "3"), but anyway - if we can look into your sample, the "DB Execute" maybe is not necessary anymore. PS: General information about saving to DBs can also be found in Saving Data to the DB.
Altova MobileTogether Experts
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/8/2015(UTC) Posts: 6 
|
Hi AFC, first of all, thank you for your quick reply. I'll attach a zip file in this post containing my mtd solution as well as the Access database involved. Thanks again for helping in this scenario. Udo
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 9/15/2014(UTC) Posts: 133  Was thanked: 18 time(s) in 18 post(s)
|
Hi Udo!
Thanks for the sample - solution is quite easy: Please right-click "$DB1" in the Page Sources tree and use the menu command "Create OriginalRowSet". This way, MobileTogether saves a copy of the original rows when loading from the DB and is able to save row modifications in the DB whenever this is wanted.
"$DB1" is now visible for your "Save" action and no "DB Execute" should be necessary.
Altova MobileTogether Experts
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/8/2015(UTC) Posts: 6 
|
Hi AFC,
I included the original row set as you described, still I get the following error (see below, sorry for German version). AMD gives me a hint regarding a data mismatch between DB1 and my Access DB ("Database: Fehler beim Parsen von '2015-12-09' als Datum und Uhrzeit für die Spalte 'DiningDate'.").
I used record type "date/time" and no further specific fomatting with Access, and "[D].[M][Y]" fomatting with AMD. I even tried to chang the date format in Access to "short date", but this didn't help either.
Udo
--- error message ---
Simulation wird begonnen ... Auf Server ausgeführt: Persistente XML-Elemente und -Attribute, die beim Laden der Seite vorhanden sein müssen, erstellen '$PERSISTENT/Root/Current/Visit/BillAmount' (Wert='100') erstellen '$PERSISTENT/Root/Current/Visit/TipPercentage' (Wert='18') erstellen '$PERSISTENT/Root/Current/Visit/TipAmount' (Wert='18') erstellen '$PERSISTENT/Root/Current/Visit/TotalAmount' (Wert='118') erstellen Auf Server ausgeführt: Nächste Seite: Tip Calculator Am Server ausgeführt: Lade '$DB1' (Datenbank: Data Source=F:\Lehre\Sem 3\Programmierübungen\MobileTogether\TipCalc_DB.accdb;Provider=Microsoft.ACE.OLEDB.12.0) Anweisung für 'tabTipCalc' vorbereiten und ausführen. Es wurden 3 Zeilen in 0.01 Sek. abgerufen Ausführungsdauer: 0.01s Vom Server an den Client übertragene Daten: Neue persistente Seiten-XML '$PERSISTENT' Vom Server an den Client übertragene Daten: Neue Seiten-XML '$DB1' Neue Seitendaten für Tip Calculator auf Client werden erstellt Der XPath '(12 to 20)' hat einen fixen Ergebniswert '12, 13, 14, 15, 16, 17, 18, 19, 20' und wird im Cache gespeichert. Ausgeführt auf Client: Steuerelement Aktion von Schaltfläche Schaltfläche1: Node anhängen '/Row' wurde erfolgreich an '$DB1/DB/RowSet' angehängt. Deaktivierte(n) DB ausführen ignorieren. Ausgeführt auf Server: Steuerelement Aktion von Schaltfläche Schaltfläche1: Am Server ausgeführt: '$DB1' (Datenbank: Data Source=F:\Lehre\Sem 3\Programmierübungen\MobileTogether\TipCalc_DB.accdb;Provider=Microsoft.ACE.OLEDB.12.0) speichern Zeile wird in 0.01 Sek. in 'tabTipCalc' eingefügt Spalte 'BillAmount': '100' Spalte 'TipPercentage': '18' Spalte 'TipAmount': '18' Spalte 'TotalAmount': '118' Spalte 'DiningDate': '2015-12-09' Database: Fehler beim Parsen von '2015-12-09' als Datum und Uhrzeit für die Spalte 'DiningDate'. Am Server ausgeführt: Datenbank 'Data Source=F:\Lehre\Sem 3\Programmierübungen\MobileTogether\TipCalc_DB.accdb;Provider=Microsoft.ACE.OLEDB.12.0' schreiben: Fehler beim Einfügen von Zeilen in 'tabTipCalc'. Am Server ausgeführt: In Datenbank schreiben 'Data Source=F:\Lehre\Sem 3\Programmierübungen\MobileTogether\TipCalc_DB.accdb;Provider=Microsoft.ACE.OLEDB.12.0'. Aufgrund des vorhergehenden Fehlers wird ein Rollback der Änderungen durchgeführt. Simulation - 3 Fehler, 0 Warnung(en)
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 9/15/2014(UTC) Posts: 133  Was thanked: 18 time(s) in 18 post(s)
|
Hello Udo! The DB column "DiningDate" of your database table is of type "Date/Time". When adding a new row, you set only a date value ( "current-date-no-TZ()" ). To fix this, you should change your "Append Node" action e.g. to: Append to Node:$DB1/DB/RowSet new Node(s): element Row { for $i in $PERSISTENT/Root/Current/Visit/* return attribute { $i/name() } { $i/text() }, attribute DiningDate { current-dateTime-no-TZ() } }
Altova MobileTogether Experts
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/8/2015(UTC) Posts: 6 
|
Hi AFC,
that solved my problem!
That you very much for your quick and extensive help! :-)
Udo
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/8/2015(UTC) Posts: 6 
|
Hi AFC,
now I ported my solution from Windows 8.1 to a PC running under Windows 10. Running the unchanged TipCalc4 solution here yields in an error message reading "'[TipCalc_DB].[tabTipCalc]' konnte für die Datenbankverbindung 'Data Source=D:\Lehre\Sem 3\Programmierübungen\MobileTogether\TipCalc_DB.accdb;Provider=Microsoft.ACE.OLEDB.12.0' nicht aufgelöst werden." that means that it could not resolve to my data base through OLEDB 12.0 although the path to TipCalc_DB.accdb is correct. The solution can not be run at all.
Is it a known error for OLEDB 12.0 under Windows 10, and if so, what can I do?
Thanks again for your kind support. Udo
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 7/21/2014(UTC) Posts: 484
Was thanked: 81 time(s) in 81 post(s)
|
Without seeing your computer I can only guess that you simply do not have the same driver as on your Windows 8 machine, which is why Windows 10 cannot resolve the connection string, and therefore is also unable to find the database.
To resolve this you can build a new connection to your database and reassign your page sources to this new connection via context menu Choose DB Data Source
If this doesn't help, contact Altova Support - they will need a lot more details about your installation.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/8/2015(UTC) Posts: 6 
|
Hi bbv, I finally could solve the problem and would like to show the solution to anybody muddling through with the same problems: After porting to Win10, users should install the Microsoft Access Database Engine 2010 Redistributable (64bit). It can be found here: https://www.microsoft.co...nfirmation.aspx?id=13255After installation - that unfortunately forced me to update MS Office from 32bit to 64bit prior - TipCalc and the likes run smoothly again. Best regards, Udo
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 7/21/2014(UTC) Posts: 484
Was thanked: 81 time(s) in 81 post(s)
|
Hi Udo,
thank you for taking time and sharing solution with other users!
|
|
|
|
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.