Date   

Re: Mobile offline programming

Lawrence Fisher
 

I understood that you were having fun...

The way it works, is:

Main Program
Login (Rich client non-interactive) called by the execution.properties
       Calls Enter login (Regular rich client) subtask
       If all OK, calls Menu (Offline rich client) 

menu waits for someone to tap.

When someone taps, Menu then raises an event (Sync from Server) in the Main Program

That is when I get -197. From what you are implying, the problem is Login?

 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Thursday, March 30, 2017 3:33 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,

I understood the book reference. Just having a bit of fun with it. No offense intended.

In my app, the online tasks are batch tasks for updating data in either direction.  All my interactive tasks are offline.   If an online task is open when the timeout occurs, I do not think you will be able to reconnect.  All my online batch tasks are launched by raising an events that are handled in the main program.

To get a better of idea of what is happening try the following:
In your startup program evaluate ClientSessionSet('EnableCommunicationDialogs','FALSE'LOG).   This will turn off the error messages.

In the Main program create an event handler for Internal Event "Unavailable Server" and set the scope to SubTree. In the handler put the following   :
Verify Warning expression = 'Unable to establish a server connection. Status code : '&Str(ServerLastAccessStatus(),'1')

Launch your app , wait for the timeout and then call a program that accesses the server.

If the returned code is 4 then –> The context is no longer available (such as due to ContextActivityTimeout) and the client could not recreate a new context in the Magic xpa server since there were non-Offline tasks in the execution call tree.

You can also check the BrokerActivity.log for more info on what is happening.

Todd

On 3/30/2017 2:58 AM, Lawrence Fisher via Groups.Io wrote:
Kill Me Now is the name of my book (http://killmenow.org)

I am doing something wrong then and I cannot figure out what. The Help and the other documentation are not helpful and neither is support
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Wednesday, March 29, 2017 9:15 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
It is working for me. I have single user RIA runtime license for XPA 3.2.   Using two tablets, I am able to push data to the server from both tablets without having to restart the Android app, provided I wait 30 seconds (see below).  If I try to do both at the same time, one of them gets an error which is to be expected.
In my magic.ini I have  ContextInactivityTimeout=300  (30 seconds)
from my mgrb.ini :
[APPLICATIONS_LIST]
My_App = MgxpaRuntime.exe /INI=\\server1\folder1\control\Magic_XPA3_RIA.ini,,,,0,1
Now please step down from the ledge or drop the gun/any other applicable object.
Todd

On 3/29/2017 11:11 AM, Lawrence Fisher via Groups.Io wrote:
I have had no success at all

Kill me now
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 4:39 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
What happens if you restart the broker after the context timeout?
I'll be visiting a customer tomorrow to test my upgrades.  I'll let you know if I have any success.
Todd


On 3/28/2017 8:49 AM, Lawrence Fisher via Groups.Io wrote:
It is "available" 

This is a regular runtime license

Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 2:34 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
In the broker monitor, what is Server Application Status after the context has timed out?
Todd

On 3/28/2017 2:19 AM, Lawrence Fisher via Groups.Io wrote:
For me that does not work.

My context does timeout but when I try the sync to server, I get the -197 which is context not found. This is 3.2a

I even tried doing this:

Updated a Main Program logical variable, "Must Sync" with TRUE
Then I have a Main Program timer event that runs every 5 minutes and if the "Must Sync" is true, runs the sync to server. -197.

What am I doing wrong?
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 2:48 AM
Subject: Re: [magicu-l] Mobile offline programming

Tim,

I'm experimenting with setting Context Inactivity Timeout in lieu of deleting a context.  I don't have a runtime license available, so I'm experimenting with Studio.  Setting the timeout to 600 ( 1 minute ) does indeed delete the inactive context, but does not allow any new contexts to be created.  I did notice that Server Application Status switches from "Available" to "Studio Mode" after the context times out.  On a customer server without any open contexts  the Server Application Status remains "Available".   I'll visit this customer later this week to run some tests.

Todd

On 3/27/2017 5:37 PM, Tim Downie wrote:
Ive had inconsistent results with this and this was due to a bug if using https which was fixed in3.1b. The only thing is you can never kill this context from the app - or at least i cant but i think this is logical as in a program can not terminate its own context.

Id like to try this process in 3.2 but havnt had the time yet. I will be back to this soon as we have another client wanting mobile


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Todd Baremore <tbaremor@...>
Sent: Monday, 27 March 2017 5:28:42 PM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Mobile offline programming
 
Tim and Lawrence,

After some guidance from MSE and pulling my foot out of my mouth, I need to make some corrections.

First, only offline programs are copied to the mobile device. This only happens when the app is started.
Second, you can open a new context by calling a non-offline program. Here is my mistake:
The ServerLastAccessStatus() does not check if the server is available. It returns the status of the LAST request, which could have been an hour ago.

To test this I started my mobile app with a connection to the server.  With my mobile app still running, I shutdown the server(s)/broker and restarted the broker.   >From the mobile app I then tried to push data to the server, which was successful.    I still need to work out server error handling, but this is great news for mobile offline development.   Anyone up for a Go-To-Meeting to put our heads together on this (and share the pain?) I'm thinking Thursday afternoon New York time.

Todd


On 3/26/2017 10:11 PM, Todd Baremore wrote:
TIm,

I agree.  Ideally a server will have a floating pool of mobile contexts.  This would allow a customer to to put your app on 20 devices while only purchasing a 5 user licenses.   At startup each device would synch the source xml files, launch your app (which would check for any data synchronization) and then drop the context if applicable for the app to do so.  For server dependent apps the device would stay connected to the server and the licensing scheme would be 1:1.  For mobile offline apps, having an N:1 licensing scheme will give us a much more affordable solution to offer our customers.  

If a mobile app is started without a server connection and the application ecf has been updated on the server you could have problems with:
DataviewToDataSource() if column names have changed
Callling server programs if the number of parameters or their data types have changed

In order for this diabolical plan to work, the developer would be responsible for determining a version difference between the server and mobile app (we can already do this) and maintaining some form of change list that could be checked after the mobile app creates a new context.  The mobile app would then need to determine if it is safe to synchronize data or call a server program.   I'm doubtful that updating the app xml files will ever be achieved with the app open and program(s) running.

I'm sure there is more to it than I have outlined here. If MSE is listening I would like to hear your thoughts on the matter.

Todd



On 3/26/2017 7:14 PM, Tim Downie wrote:
This is where in my belief magic mobile is flawed....you should be able to open a connection (context ) when you like and then immediately terminate it, and then create another one if/when you need to interact with the server - this  reduces connections to the server etc.

if you start without a context it will then create one, but it should also be able to create a new context if for some reason the context is not found.





From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Todd Baremore <tbaremor@...>
Sent: Sunday, 26 March 2017 3:04 PM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Mobile offline programming
 
Lawrence,
This is my understanding and experience of how contexts works.  If anyone knows better please correct me as needed.
A context is added to the server upon startup of your mobile device application, assuming your device has network access to the server.  With the Context Inactivity Timeout set to 2 minutes,  if your device has not made any requests of the server in 2 minutes, the context is closed and your app is now offline.   The only way to reestablish a context is to close and restart the app.  The default Context Inactivity Timeout is 24 hours which means you could start your app in Seattle in the morning, catch a flight to New York and still have the same context available when you land in New York as long as you leave the app running.
Open the broker monitor on your server before starting your mobile app.  You will see the traffic coming from you mobile device and the creation of a context for your device.  The first time you run your app, the source xml is sent to the device which is why it takes a bit longer to start the first time.
Assuming the Context Inactivity Timeout is set to 24 hours, if you want to test what happens to your app when it loses the connection to the server, start your mobile app, turn off the mobile/WiFi data connections on your device.  Work with your app for a few minutes and then turn on your mobile/WiFi connections on and try to send data to the server. In the Broker Monitor you will notice that the context is maintained even though the device has lost its network connections.
This could prove helpful in your next book, "Kill Me Again", amusing anecdotes from the world of Magic mobile development
Todd

On 3/26/2017 8:51 AM, Lawrence Fisher via Groups.Io wrote:
Hi all

I am tried to define a proof of concept working with offline mobile.

I defined a Context Timeout of 2 mins.

I managed to get the sync from server to client working with no problem. Once there is the timeout, the client continues to work.
The problem is when I need to update the server, meaning "client to server"

From what I understand from the documentation, when you make the first server access, such as accessing a server table, there is a connection to the server. What I get is an error -197 which is context not found.

What am I doing wrong?


 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



















Re: Get.dll crashing unipaas 1.9 all of a sudden

Florian Groothuis
 

We had the same problem a few years ago. In our case it depended on the number of printers a user had assigned to his account. Try raising the buffer size with “GET_SET_PRN_BUFFSIZE”. We set it to 10000.

 

Van: main@magicu-l.groups.io [mailto:main@magicu-l.groups.io] Namens John Knickerbocker
Verzonden: donderdag 30 maart 2017 14:15
Aan: main@magicu-l.groups.io
Onderwerp: [magicu-l] Get.dll crashing unipaas 1.9 all of a sudden

 

Hello group,

 

We have a client that we use get.dll with in order to retrieve the list of windows printers. It has been working for years now, but this week it began crashing right when the dll is called. Not every time, sometimes it works without crashing. Has anyone else seen this behavior?

 

Met vriendelijke groet - With kind regards,

Florian Groothuis
Analist/programmeur
+31 (0)6 21927914


meilink.eu

Meilink Beheer Borculo B.V. • Kamerlingh Onnesstraat 1
7271 AZ  Borculo • Nederland • +31 (0)545 253525
KvK 08009803 • Our general terms and conditions apply • Disclaimer



Re: Get.dll crashing unipaas 1.9 all of a sudden

De Netwerkadviseur BV
 

Hi John,

I had crashes of this caused by printerdriverupdates. Ignoring the update caused the crash. I think there should be changed something with your printerdriverlist that GET cannot handle.

Best regards,
André


Re: Mobile offline programming

Todd Baremore
 

Lawrence,

I understood the book reference. Just having a bit of fun with it. No offense intended.

In my app, the online tasks are batch tasks for updating data in either direction.  All my interactive tasks are offline.   If an online task is open when the timeout occurs, I do not think you will be able to reconnect.  All my online batch tasks are launched by raising an events that are handled in the main program.

To get a better of idea of what is happening try the following:
In your startup program evaluate ClientSessionSet('EnableCommunicationDialogs','FALSE'LOG).   This will turn off the error messages.

In the Main program create an event handler for Internal Event "Unavailable Server" and set the scope to SubTree. In the handler put the following   :
Verify Warning expression = 'Unable to establish a server connection. Status code : '&Str(ServerLastAccessStatus(),'1')

Launch your app , wait for the timeout and then call a program that accesses the server.

If the returned code is 4 then –> The context is no longer available (such as due to ContextActivityTimeout) and the client could not recreate a new context in the Magic xpa server since there were non-Offline tasks in the execution call tree.

You can also check the BrokerActivity.log for more info on what is happening.

Todd

On 3/30/2017 2:58 AM, Lawrence Fisher via Groups.Io wrote:
Kill Me Now is the name of my book (http://killmenow.org)

I am doing something wrong then and I cannot figure out what. The Help and the other documentation are not helpful and neither is support
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Wednesday, March 29, 2017 9:15 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
It is working for me. I have single user RIA runtime license for XPA 3.2.   Using two tablets, I am able to push data to the server from both tablets without having to restart the Android app, provided I wait 30 seconds (see below).  If I try to do both at the same time, one of them gets an error which is to be expected.
In my magic.ini I have  ContextInactivityTimeout=300  (30 seconds)
from my mgrb.ini :
[APPLICATIONS_LIST]
My_App = MgxpaRuntime.exe /INI=\\server1\folder1\control\Magic_XPA3_RIA.ini,,,,0,1
Now please step down from the ledge or drop the gun/any other applicable object.
Todd

On 3/29/2017 11:11 AM, Lawrence Fisher via Groups.Io wrote:
I have had no success at all

Kill me now
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 4:39 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
What happens if you restart the broker after the context timeout?
I'll be visiting a customer tomorrow to test my upgrades.  I'll let you know if I have any success.
Todd


On 3/28/2017 8:49 AM, Lawrence Fisher via Groups.Io wrote:
It is "available" 

This is a regular runtime license

Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 2:34 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
In the broker monitor, what is Server Application Status after the context has timed out?
Todd

On 3/28/2017 2:19 AM, Lawrence Fisher via Groups.Io wrote:
For me that does not work.

My context does timeout but when I try the sync to server, I get the -197 which is context not found. This is 3.2a

I even tried doing this:

Updated a Main Program logical variable, "Must Sync" with TRUE
Then I have a Main Program timer event that runs every 5 minutes and if the "Must Sync" is true, runs the sync to server. -197.

What am I doing wrong?
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 2:48 AM
Subject: Re: [magicu-l] Mobile offline programming

Tim,

I'm experimenting with setting Context Inactivity Timeout in lieu of deleting a context.  I don't have a runtime license available, so I'm experimenting with Studio.  Setting the timeout to 600 ( 1 minute ) does indeed delete the inactive context, but does not allow any new contexts to be created.  I did notice that Server Application Status switches from "Available" to "Studio Mode" after the context times out.  On a customer server without any open contexts  the Server Application Status remains "Available".   I'll visit this customer later this week to run some tests.

Todd

On 3/27/2017 5:37 PM, Tim Downie wrote:
Ive had inconsistent results with this and this was due to a bug if using https which was fixed in3.1b. The only thing is you can never kill this context from the app - or at least i cant but i think this is logical as in a program can not terminate its own context.

Id like to try this process in 3.2 but havnt had the time yet. I will be back to this soon as we have another client wanting mobile


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Todd Baremore <tbaremor@...>
Sent: Monday, 27 March 2017 5:28:42 PM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Mobile offline programming
 
Tim and Lawrence,

After some guidance from MSE and pulling my foot out of my mouth, I need to make some corrections.

First, only offline programs are copied to the mobile device. This only happens when the app is started.
Second, you can open a new context by calling a non-offline program. Here is my mistake:
The ServerLastAccessStatus() does not check if the server is available. It returns the status of the LAST request, which could have been an hour ago.

To test this I started my mobile app with a connection to the server.  With my mobile app still running, I shutdown the server(s)/broker and restarted the broker.   >From the mobile app I then tried to push data to the server, which was successful.    I still need to work out server error handling, but this is great news for mobile offline development.   Anyone up for a Go-To-Meeting to put our heads together on this (and share the pain?) I'm thinking Thursday afternoon New York time.

Todd


On 3/26/2017 10:11 PM, Todd Baremore wrote:
TIm,

I agree.  Ideally a server will have a floating pool of mobile contexts.  This would allow a customer to to put your app on 20 devices while only purchasing a 5 user licenses.   At startup each device would synch the source xml files, launch your app (which would check for any data synchronization) and then drop the context if applicable for the app to do so.  For server dependent apps the device would stay connected to the server and the licensing scheme would be 1:1.  For mobile offline apps, having an N:1 licensing scheme will give us a much more affordable solution to offer our customers.  

If a mobile app is started without a server connection and the application ecf has been updated on the server you could have problems with:
DataviewToDataSource() if column names have changed
Callling server programs if the number of parameters or their data types have changed

In order for this diabolical plan to work, the developer would be responsible for determining a version difference between the server and mobile app (we can already do this) and maintaining some form of change list that could be checked after the mobile app creates a new context.  The mobile app would then need to determine if it is safe to synchronize data or call a server program.   I'm doubtful that updating the app xml files will ever be achieved with the app open and program(s) running.

I'm sure there is more to it than I have outlined here. If MSE is listening I would like to hear your thoughts on the matter.

Todd



On 3/26/2017 7:14 PM, Tim Downie wrote:
This is where in my belief magic mobile is flawed....you should be able to open a connection (context ) when you like and then immediately terminate it, and then create another one if/when you need to interact with the server - this  reduces connections to the server etc.

if you start without a context it will then create one, but it should also be able to create a new context if for some reason the context is not found.





From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Todd Baremore <tbaremor@...>
Sent: Sunday, 26 March 2017 3:04 PM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Mobile offline programming
 
Lawrence,
This is my understanding and experience of how contexts works.  If anyone knows better please correct me as needed.
A context is added to the server upon startup of your mobile device application, assuming your device has network access to the server.  With the Context Inactivity Timeout set to 2 minutes,  if your device has not made any requests of the server in 2 minutes, the context is closed and your app is now offline.   The only way to reestablish a context is to close and restart the app.  The default Context Inactivity Timeout is 24 hours which means you could start your app in Seattle in the morning, catch a flight to New York and still have the same context available when you land in New York as long as you leave the app running.
Open the broker monitor on your server before starting your mobile app.  You will see the traffic coming from you mobile device and the creation of a context for your device.  The first time you run your app, the source xml is sent to the device which is why it takes a bit longer to start the first time.
Assuming the Context Inactivity Timeout is set to 24 hours, if you want to test what happens to your app when it loses the connection to the server, start your mobile app, turn off the mobile/WiFi data connections on your device.  Work with your app for a few minutes and then turn on your mobile/WiFi connections on and try to send data to the server. In the Broker Monitor you will notice that the context is maintained even though the device has lost its network connections.
This could prove helpful in your next book, "Kill Me Again", amusing anecdotes from the world of Magic mobile development
Todd

On 3/26/2017 8:51 AM, Lawrence Fisher via Groups.Io wrote:
Hi all

I am tried to define a proof of concept working with offline mobile.

I defined a Context Timeout of 2 mins.

I managed to get the sync from server to client working with no problem. Once there is the timeout, the client continues to work.
The problem is when I need to update the server, meaning "client to server"

From what I understand from the documentation, when you make the first server access, such as accessing a server table, there is a connection to the server. What I get is an error -197 which is context not found.

What am I doing wrong?


 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating

















Get.dll crashing unipaas 1.9 all of a sudden

John Knickerbocker
 

Hello group,

We have a client that we use get.dll with in order to retrieve the list of windows printers. It has been working for years now, but this week it began crashing right when the dll is called. Not every time, sometimes it works without crashing. Has anyone else seen this behavior?


Re: Behavior XPA vs Unipaas

koen_roefs@...
 

Hello Harry,

that's exactly what I needed.

Thanks a lot.

Best Regards

Koen


Re: Behavior XPA vs Unipaas

harry@...
 

Hi Koen,

From the release notes:

SpecialExpReturnNull – This flag maintains backward compatibility when comparing a variable that has a Null value to an empty value.

Best regards,

Harry Kleinsmit.


Behavior XPA vs Unipaas

koen_roefs@...
 

Hello All,

I have started to see what we have to do to transfer our application from Unipaas to XPA.

But I have noticed other behavior in XPA.

If you create the following program in Unipaas and in XPA:

Variable A = Alpha U20, NULL Allowed

Record Suffix

Update A with NULL()

IF TRIM(A)<>'' THEN 'OK' END IF

In Unipaas the OK is not shown, but in XPA it will show the OK.

Is there something changed at the TRIM-function in XPA?

I have tried to add the special setting SpecialTrimTrailingNulls in the INI-file, but nothing has changed.


Any ideas? Thanks in advance

Best regards

Koen


Re: Mobile offline programming

Lawrence Fisher
 

Kill Me Now is the name of my book (http://killmenow.org)

I am doing something wrong then and I cannot figure out what. The Help and the other documentation are not helpful and neither is support
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Wednesday, March 29, 2017 9:15 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
It is working for me. I have single user RIA runtime license for XPA 3.2.   Using two tablets, I am able to push data to the server from both tablets without having to restart the Android app, provided I wait 30 seconds (see below).  If I try to do both at the same time, one of them gets an error which is to be expected.
In my magic.ini I have  ContextInactivityTimeout=300  (30 seconds)
from my mgrb.ini :
[APPLICATIONS_LIST]
My_App = MgxpaRuntime.exe /INI=\\server1\folder1\control\Magic_XPA3_RIA.ini,,,,0,1
Now please step down from the ledge or drop the gun/any other applicable object.
Todd

On 3/29/2017 11:11 AM, Lawrence Fisher via Groups.Io wrote:
I have had no success at all

Kill me now
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 4:39 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
What happens if you restart the broker after the context timeout?
I'll be visiting a customer tomorrow to test my upgrades.  I'll let you know if I have any success.
Todd


On 3/28/2017 8:49 AM, Lawrence Fisher via Groups.Io wrote:
It is "available" 

This is a regular runtime license

Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 2:34 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
In the broker monitor, what is Server Application Status after the context has timed out?
Todd

On 3/28/2017 2:19 AM, Lawrence Fisher via Groups.Io wrote:
For me that does not work.

My context does timeout but when I try the sync to server, I get the -197 which is context not found. This is 3.2a

I even tried doing this:

Updated a Main Program logical variable, "Must Sync" with TRUE
Then I have a Main Program timer event that runs every 5 minutes and if the "Must Sync" is true, runs the sync to server. -197.

What am I doing wrong?
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 2:48 AM
Subject: Re: [magicu-l] Mobile offline programming

Tim,

I'm experimenting with setting Context Inactivity Timeout in lieu of deleting a context.  I don't have a runtime license available, so I'm experimenting with Studio.  Setting the timeout to 600 ( 1 minute ) does indeed delete the inactive context, but does not allow any new contexts to be created.  I did notice that Server Application Status switches from "Available" to "Studio Mode" after the context times out.  On a customer server without any open contexts  the Server Application Status remains "Available".   I'll visit this customer later this week to run some tests.

Todd

On 3/27/2017 5:37 PM, Tim Downie wrote:
Ive had inconsistent results with this and this was due to a bug if using https which was fixed in3.1b. The only thing is you can never kill this context from the app - or at least i cant but i think this is logical as in a program can not terminate its own context.

Id like to try this process in 3.2 but havnt had the time yet. I will be back to this soon as we have another client wanting mobile


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Todd Baremore <tbaremor@...>
Sent: Monday, 27 March 2017 5:28:42 PM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Mobile offline programming
 
Tim and Lawrence,

After some guidance from MSE and pulling my foot out of my mouth, I need to make some corrections.

First, only offline programs are copied to the mobile device. This only happens when the app is started.
Second, you can open a new context by calling a non-offline program. Here is my mistake:
The ServerLastAccessStatus() does not check if the server is available. It returns the status of the LAST request, which could have been an hour ago.

To test this I started my mobile app with a connection to the server.  With my mobile app still running, I shutdown the server(s)/broker and restarted the broker.   From the mobile app I then tried to push data to the server, which was successful.    I still need to work out server error handling, but this is great news for mobile offline development.   Anyone up for a Go-To-Meeting to put our heads together on this (and share the pain?) I'm thinking Thursday afternoon New York time.

Todd


On 3/26/2017 10:11 PM, Todd Baremore wrote:
TIm,

I agree.  Ideally a server will have a floating pool of mobile contexts.  This would allow a customer to to put your app on 20 devices while only purchasing a 5 user licenses.   At startup each device would synch the source xml files, launch your app (which would check for any data synchronization) and then drop the context if applicable for the app to do so.  For server dependent apps the device would stay connected to the server and the licensing scheme would be 1:1.  For mobile offline apps, having an N:1 licensing scheme will give us a much more affordable solution to offer our customers.  

If a mobile app is started without a server connection and the application ecf has been updated on the server you could have problems with:
DataviewToDataSource() if column names have changed
Callling server programs if the number of parameters or their data types have changed

In order for this diabolical plan to work, the developer would be responsible for determining a version difference between the server and mobile app (we can already do this) and maintaining some form of change list that could be checked after the mobile app creates a new context.  The mobile app would then need to determine if it is safe to synchronize data or call a server program.   I'm doubtful that updating the app xml files will ever be achieved with the app open and program(s) running.

I'm sure there is more to it than I have outlined here. If MSE is listening I would like to hear your thoughts on the matter.

Todd



On 3/26/2017 7:14 PM, Tim Downie wrote:
This is where in my belief magic mobile is flawed....you should be able to open a connection (context ) when you like and then immediately terminate it, and then create another one if/when you need to interact with the server - this  reduces connections to the server etc.

if you start without a context it will then create one, but it should also be able to create a new context if for some reason the context is not found.





From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Todd Baremore <tbaremor@...>
Sent: Sunday, 26 March 2017 3:04 PM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Mobile offline programming
 
Lawrence,
This is my understanding and experience of how contexts works.  If anyone knows better please correct me as needed.
A context is added to the server upon startup of your mobile device application, assuming your device has network access to the server.  With the Context Inactivity Timeout set to 2 minutes,  if your device has not made any requests of the server in 2 minutes, the context is closed and your app is now offline.   The only way to reestablish a context is to close and restart the app.  The default Context Inactivity Timeout is 24 hours which means you could start your app in Seattle in the morning, catch a flight to New York and still have the same context available when you land in New York as long as you leave the app running.
Open the broker monitor on your server before starting your mobile app.  You will see the traffic coming from you mobile device and the creation of a context for your device.  The first time you run your app, the source xml is sent to the device which is why it takes a bit longer to start the first time.
Assuming the Context Inactivity Timeout is set to 24 hours, if you want to test what happens to your app when it loses the connection to the server, start your mobile app, turn off the mobile/WiFi data connections on your device.  Work with your app for a few minutes and then turn on your mobile/WiFi connections on and try to send data to the server. In the Broker Monitor you will notice that the context is maintained even though the device has lost its network connections.
This could prove helpful in your next book, "Kill Me Again", amusing anecdotes from the world of Magic mobile development
Todd

On 3/26/2017 8:51 AM, Lawrence Fisher via Groups.Io wrote:
Hi all

I am tried to define a proof of concept working with offline mobile.

I defined a Context Timeout of 2 mins.

I managed to get the sync from server to client working with no problem. Once there is the timeout, the client continues to work.
The problem is when I need to update the server, meaning "client to server"

From what I understand from the documentation, when you make the first server access, such as accessing a server table, there is a connection to the server. What I get is an error -197 which is context not found.

What am I doing wrong?


 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating
















Re: Mobile offline programming

Todd Baremore
 

Lawrence,

It is working for me. I have single user RIA runtime license for XPA 3.2.   Using two tablets, I am able to push data to the server from both tablets without having to restart the Android app, provided I wait 30 seconds (see below).  If I try to do both at the same time, one of them gets an error which is to be expected.

In my magic.ini I have  ContextInactivityTimeout=300  (30 seconds)

from my mgrb.ini :
[APPLICATIONS_LIST]
My_App = MgxpaRuntime.exe /INI=\\server1\folder1\control\Magic_XPA3_RIA.ini,,,,0,1

Now please step down from the ledge or drop the gun/any other applicable object.

Todd


On 3/29/2017 11:11 AM, Lawrence Fisher via Groups.Io wrote:
I have had no success at all

Kill me now
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 4:39 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
What happens if you restart the broker after the context timeout?
I'll be visiting a customer tomorrow to test my upgrades.  I'll let you know if I have any success.
Todd


On 3/28/2017 8:49 AM, Lawrence Fisher via Groups.Io wrote:
It is "available" 

This is a regular runtime license

Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 2:34 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
In the broker monitor, what is Server Application Status after the context has timed out?
Todd

On 3/28/2017 2:19 AM, Lawrence Fisher via Groups.Io wrote:
For me that does not work.

My context does timeout but when I try the sync to server, I get the -197 which is context not found. This is 3.2a

I even tried doing this:

Updated a Main Program logical variable, "Must Sync" with TRUE
Then I have a Main Program timer event that runs every 5 minutes and if the "Must Sync" is true, runs the sync to server. -197.

What am I doing wrong?
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 2:48 AM
Subject: Re: [magicu-l] Mobile offline programming

Tim,

I'm experimenting with setting Context Inactivity Timeout in lieu of deleting a context.  I don't have a runtime license available, so I'm experimenting with Studio.  Setting the timeout to 600 ( 1 minute ) does indeed delete the inactive context, but does not allow any new contexts to be created.  I did notice that Server Application Status switches from "Available" to "Studio Mode" after the context times out.  On a customer server without any open contexts  the Server Application Status remains "Available".   I'll visit this customer later this week to run some tests.

Todd

On 3/27/2017 5:37 PM, Tim Downie wrote:
Ive had inconsistent results with this and this was due to a bug if using https which was fixed in3.1b. The only thing is you can never kill this context from the app - or at least i cant but i think this is logical as in a program can not terminate its own context.

Id like to try this process in 3.2 but havnt had the time yet. I will be back to this soon as we have another client wanting mobile


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Todd Baremore <tbaremor@...>
Sent: Monday, 27 March 2017 5:28:42 PM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Mobile offline programming
 
Tim and Lawrence,

After some guidance from MSE and pulling my foot out of my mouth, I need to make some corrections.

First, only offline programs are copied to the mobile device. This only happens when the app is started.
Second, you can open a new context by calling a non-offline program. Here is my mistake:
The ServerLastAccessStatus() does not check if the server is available. It returns the status of the LAST request, which could have been an hour ago.

To test this I started my mobile app with a connection to the server.  With my mobile app still running, I shutdown the server(s)/broker and restarted the broker.   From the mobile app I then tried to push data to the server, which was successful.    I still need to work out server error handling, but this is great news for mobile offline development.   Anyone up for a Go-To-Meeting to put our heads together on this (and share the pain?) I'm thinking Thursday afternoon New York time.

Todd


On 3/26/2017 10:11 PM, Todd Baremore wrote:
TIm,

I agree.  Ideally a server will have a floating pool of mobile contexts.  This would allow a customer to to put your app on 20 devices while only purchasing a 5 user licenses.   At startup each device would synch the source xml files, launch your app (which would check for any data synchronization) and then drop the context if applicable for the app to do so.  For server dependent apps the device would stay connected to the server and the licensing scheme would be 1:1.  For mobile offline apps, having an N:1 licensing scheme will give us a much more affordable solution to offer our customers.  

If a mobile app is started without a server connection and the application ecf has been updated on the server you could have problems with:
DataviewToDataSource() if column names have changed
Callling server programs if the number of parameters or their data types have changed

In order for this diabolical plan to work, the developer would be responsible for determining a version difference between the server and mobile app (we can already do this) and maintaining some form of change list that could be checked after the mobile app creates a new context.  The mobile app would then need to determine if it is safe to synchronize data or call a server program.   I'm doubtful that updating the app xml files will ever be achieved with the app open and program(s) running.

I'm sure there is more to it than I have outlined here. If MSE is listening I would like to hear your thoughts on the matter.

Todd



On 3/26/2017 7:14 PM, Tim Downie wrote:
This is where in my belief magic mobile is flawed....you should be able to open a connection (context ) when you like and then immediately terminate it, and then create another one if/when you need to interact with the server - this  reduces connections to the server etc.

if you start without a context it will then create one, but it should also be able to create a new context if for some reason the context is not found.





From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Todd Baremore <tbaremor@...>
Sent: Sunday, 26 March 2017 3:04 PM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Mobile offline programming
 
Lawrence,
This is my understanding and experience of how contexts works.  If anyone knows better please correct me as needed.
A context is added to the server upon startup of your mobile device application, assuming your device has network access to the server.  With the Context Inactivity Timeout set to 2 minutes,  if your device has not made any requests of the server in 2 minutes, the context is closed and your app is now offline.   The only way to reestablish a context is to close and restart the app.  The default Context Inactivity Timeout is 24 hours which means you could start your app in Seattle in the morning, catch a flight to New York and still have the same context available when you land in New York as long as you leave the app running.
Open the broker monitor on your server before starting your mobile app.  You will see the traffic coming from you mobile device and the creation of a context for your device.  The first time you run your app, the source xml is sent to the device which is why it takes a bit longer to start the first time.
Assuming the Context Inactivity Timeout is set to 24 hours, if you want to test what happens to your app when it loses the connection to the server, start your mobile app, turn off the mobile/WiFi data connections on your device.  Work with your app for a few minutes and then turn on your mobile/WiFi connections on and try to send data to the server. In the Broker Monitor you will notice that the context is maintained even though the device has lost its network connections.
This could prove helpful in your next book, "Kill Me Again", amusing anecdotes from the world of Magic mobile development
Todd

On 3/26/2017 8:51 AM, Lawrence Fisher via Groups.Io wrote:
Hi all

I am tried to define a proof of concept working with offline mobile.

I defined a Context Timeout of 2 mins.

I managed to get the sync from server to client working with no problem. Once there is the timeout, the client continues to work.
The problem is when I need to update the server, meaning "client to server"

From what I understand from the documentation, when you make the first server access, such as accessing a server table, there is a connection to the server. What I get is an error -197 which is context not found.

What am I doing wrong?


 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating














Re: Mobile offline programming

Lawrence Fisher
 

I have had no success at all

Kill me now
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 4:39 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
What happens if you restart the broker after the context timeout?
I'll be visiting a customer tomorrow to test my upgrades.  I'll let you know if I have any success.
Todd


On 3/28/2017 8:49 AM, Lawrence Fisher via Groups.Io wrote:
It is "available" 

This is a regular runtime license

Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 2:34 PM
Subject: Re: [magicu-l] Mobile offline programming

Lawrence,
In the broker monitor, what is Server Application Status after the context has timed out?
Todd

On 3/28/2017 2:19 AM, Lawrence Fisher via Groups.Io wrote:
For me that does not work.

My context does timeout but when I try the sync to server, I get the -197 which is context not found. This is 3.2a

I even tried doing this:

Updated a Main Program logical variable, "Must Sync" with TRUE
Then I have a Main Program timer event that runs every 5 minutes and if the "Must Sync" is true, runs the sync to server. -197.

What am I doing wrong?
 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating



From: Todd Baremore <tbaremor@...>
To: main@magicu-l.groups.io
Sent: Tuesday, March 28, 2017 2:48 AM
Subject: Re: [magicu-l] Mobile offline programming

Tim,

I'm experimenting with setting Context Inactivity Timeout in lieu of deleting a context.  I don't have a runtime license available, so I'm experimenting with Studio.  Setting the timeout to 600 ( 1 minute ) does indeed delete the inactive context, but does not allow any new contexts to be created.  I did notice that Server Application Status switches from "Available" to "Studio Mode" after the context times out.  On a customer server without any open contexts  the Server Application Status remains "Available".   I'll visit this customer later this week to run some tests.

Todd

On 3/27/2017 5:37 PM, Tim Downie wrote:
Ive had inconsistent results with this and this was due to a bug if using https which was fixed in3.1b. The only thing is you can never kill this context from the app - or at least i cant but i think this is logical as in a program can not terminate its own context.

Id like to try this process in 3.2 but havnt had the time yet. I will be back to this soon as we have another client wanting mobile


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Todd Baremore <tbaremor@...>
Sent: Monday, 27 March 2017 5:28:42 PM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Mobile offline programming
 
Tim and Lawrence,

After some guidance from MSE and pulling my foot out of my mouth, I need to make some corrections.

First, only offline programs are copied to the mobile device. This only happens when the app is started.
Second, you can open a new context by calling a non-offline program. Here is my mistake:
The ServerLastAccessStatus() does not check if the server is available. It returns the status of the LAST request, which could have been an hour ago.

To test this I started my mobile app with a connection to the server.  With my mobile app still running, I shutdown the server(s)/broker and restarted the broker.   From the mobile app I then tried to push data to the server, which was successful.    I still need to work out server error handling, but this is great news for mobile offline development.   Anyone up for a Go-To-Meeting to put our heads together on this (and share the pain?) I'm thinking Thursday afternoon New York time.

Todd


On 3/26/2017 10:11 PM, Todd Baremore wrote:
TIm,

I agree.  Ideally a server will have a floating pool of mobile contexts.  This would allow a customer to to put your app on 20 devices while only purchasing a 5 user licenses.   At startup each device would synch the source xml files, launch your app (which would check for any data synchronization) and then drop the context if applicable for the app to do so.  For server dependent apps the device would stay connected to the server and the licensing scheme would be 1:1.  For mobile offline apps, having an N:1 licensing scheme will give us a much more affordable solution to offer our customers.  

If a mobile app is started without a server connection and the application ecf has been updated on the server you could have problems with:
DataviewToDataSource() if column names have changed
Callling server programs if the number of parameters or their data types have changed

In order for this diabolical plan to work, the developer would be responsible for determining a version difference between the server and mobile app (we can already do this) and maintaining some form of change list that could be checked after the mobile app creates a new context.  The mobile app would then need to determine if it is safe to synchronize data or call a server program.   I'm doubtful that updating the app xml files will ever be achieved with the app open and program(s) running.

I'm sure there is more to it than I have outlined here. If MSE is listening I would like to hear your thoughts on the matter.

Todd



On 3/26/2017 7:14 PM, Tim Downie wrote:
This is where in my belief magic mobile is flawed....you should be able to open a connection (context ) when you like and then immediately terminate it, and then create another one if/when you need to interact with the server - this  reduces connections to the server etc.

if you start without a context it will then create one, but it should also be able to create a new context if for some reason the context is not found.





From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Todd Baremore <tbaremor@...>
Sent: Sunday, 26 March 2017 3:04 PM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Mobile offline programming
 
Lawrence,
This is my understanding and experience of how contexts works.  If anyone knows better please correct me as needed.
A context is added to the server upon startup of your mobile device application, assuming your device has network access to the server.  With the Context Inactivity Timeout set to 2 minutes,  if your device has not made any requests of the server in 2 minutes, the context is closed and your app is now offline.   The only way to reestablish a context is to close and restart the app.  The default Context Inactivity Timeout is 24 hours which means you could start your app in Seattle in the morning, catch a flight to New York and still have the same context available when you land in New York as long as you leave the app running.
Open the broker monitor on your server before starting your mobile app.  You will see the traffic coming from you mobile device and the creation of a context for your device.  The first time you run your app, the source xml is sent to the device which is why it takes a bit longer to start the first time.
Assuming the Context Inactivity Timeout is set to 24 hours, if you want to test what happens to your app when it loses the connection to the server, start your mobile app, turn off the mobile/WiFi data connections on your device.  Work with your app for a few minutes and then turn on your mobile/WiFi connections on and try to send data to the server. In the Broker Monitor you will notice that the context is maintained even though the device has lost its network connections.
This could prove helpful in your next book, "Kill Me Again", amusing anecdotes from the world of Magic mobile development
Todd

On 3/26/2017 8:51 AM, Lawrence Fisher via Groups.Io wrote:
Hi all

I am tried to define a proof of concept working with offline mobile.

I defined a Context Timeout of 2 mins.

I managed to get the sync from server to client working with no problem. Once there is the timeout, the client continues to work.
The problem is when I need to update the server, meaning "client to server"

From what I understand from the documentation, when you make the first server access, such as accessing a server table, there is a connection to the server. What I get is an error -197 which is context not found.

What am I doing wrong?


 
Regards

Lawrence
Author of the award winning book, "Kill Me Now!", amusing stories from the world of dating













Re: How to read Structure of a Btrieve File

Lado Wali
 

Thanks Govert, I am currently out but will let you know when I get back.

Regards,
Lado


On Wed, Mar 29, 2017 at 4:28 AM, Govert Schipper <govertschipper@...> wrote:

Lado,


If you send me your export file from version 5, I will be happy to convert it to version 8 and than 9 for you.


Govert




Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Lado Wali <ladowali@...>
Verzonden: dinsdag 28 maart 2017 17:38

Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] How to read Structure of a Btrieve File
 
Thanks Govert. I'll have to find version 8 first. I believe, I have ver 9 but not 8.

Regards,
Lado
 

On Tue, Mar 28, 2017 at 11:10 AM, Govert Schipper <govertschipper@...> wrote:

Lado,


You don't have to migrate the complete application, just the data repository (and maybe the models if you like). Just use the Magic export function from version 5. Than import this into a new versio 8 application and repeat these steps. Than import into version 9 and repeat again. Finally import in uniPaaS and use the AddOn utility DDFMaker.


Govert




Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Lado Wali <ladowali@...>
Verzonden: dinsdag 28 maart 2017 16:25

Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] How to read Structure of a Btrieve File
 
We are currently using uniPaaS 1.9d and the dos base application is sitting in Magic 5.03c. The dos base magic application is a engineering application and it is already re-written in Labview but because dosbase application has many applications with hundreds of tables, it require to read the data externally to move to the labview mysql database.

What is the method to convert Magic 5.03c application to uniPaaS 1.9d so I can create DDF files. Can some one please write the steps so I can try that.

Thanks
Lado
 

On Tue, Mar 28, 2017 at 9:16 AM, Rob Westland <magicrob@...> wrote:
Hi Lado,

I think the easiest way is to export the data repository from that old dos program and import it in Magic 8, then go to Magic 9 and to XPA.

Rob


Op 28-3-2017 om 14:49 schreef Lado Wali:
Govert,

Ok, actually we have very old magic application in dos base and it is using bunch of .dat files. I found that I can see the definition in the old dos base magic. The software person wanted to read the data from all those files through the program. Please advise if it can be done through DDF and how to create DDF files out of the old dos base magic and then how to read DDF files?

Thanks
Lado


On Tue, Mar 28, 2017 at 7:10 AM, Govert Schipper <govertschipper@...> wrote:

Lado,


The only thing you know for sure is the total record length (1620 bytes) and that the first field is an integer of 2 bytes, probably just a sequence number. The rest of the record you can try to determine by looking at the contents of the remaining 1618 bytes.


Was this file created/populate using Magic? Do you have DDF files? Than you can view the record structure using Pervasive Control Center.


Govert




Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Lado Wali <ladowali@...>
Verzonden: maandag 27 maart 2017 23:58
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] How to read Structure of a Btrieve File
 
File Statistics for c:\downloads\aaa\aa1\gsfil053.dat

File Version = 9.50
Page Size = 2048
Page Preallocation = No
Key Only = No
Extended = No

Total Number of Records = 30
Record Length = 1620
Record Compression = No
Page Compression = No
Variable Records = No

Available Linked Duplicate Keys = 0
Balanced Key = No
Log Key = SYSKEY
System Data = Yes
   SYSKEY Status = Present
Total Number of Keys = 1
Total Number of Segments = 1

Key         Position        Type            Null Values*               ACS
    Segment          Length           Flags              Unique Values
  0    1         1       2  Integer      M      --                30    --

Legend:
 < = Descending Order
 D = Duplicates Allowed
 I = Case Insensitive
 M = Modifiable
 R = Repeat Duplicate
 A = Any Segment (Manual)
 L = All Segments (Null)
 * = The values in this column are hexadecimal.
?? = Unknown
-- = Not Specified


Arch,

From the above report, it looks like one field of integer and I tried putting one field with numeric from 1 to 10 digits and tried opening bit it does not open the file. Do you guess something else?

Thanks
Lado




On Mon, Mar 27, 2017 at 5:07 PM, Arch <Arch.Lineberger@...> wrote:
Btrieve only knows the file length and key position/type. I'm afraid - short of some utility - you will have to parse the fields as described to specify the fields to Magic.

Best regards,

Arch

On Mon, Mar 27, 2017 at 5:00 PM, Lado Wali <ladowali@...> wrote:
Arch,

I do not have any file structure for ctrl+G but have many btrieve files that I need to open.

I am trying right now with Pervasive utility if I can find some information to create the definition.

Thx


On Mon, Mar 27, 2017 at 4:34 PM, Arch <Arch.Lineberger@...> wrote:
Lado,

From a long time ago by Steve Blank, I believe:

Method 1

1 – Ctl+G in the data dictionary to find the file (Definition Mismatch)

2 - Uncheck "Check definition" and "Check index" and "Change tables in Studio" in the relevant Database Properties.

3 – Add a field at the end of the file in question.

4 – Exit the file and arrow-up, DO NOT CONVERT

5 – Remove the field just added

6 – Exit the file and arrow-up, DO CONVERT

7 – Database/Properties, Check Definition = Yes

Chances are, at some point in the record, the fields start looking funky. That is where your mismatch is. Generally a field was added, but the data not converted. Usually the easiest fix is to delete the added field, so everything lines up. Then add the field again, and make sure Magic can reformat the file (or that you have a program to do the reformat). 

Method 2

Use the Pervasive utility called DDF Builder. In addition to showing you the overall record length and index structure that the Maintenance utilities display, DDF Builder will also display actual data to help you figure out where one non-indexed column ends and the next begins.

On the downside, DDF Builder is not terribly intuitive to use and is really a 95%-completed product. In the end however, Magic's Definition Mismatch error can only compare overall record length and index structure, so the aforementioned maintenance utilities will reveal enough information to at least solve the Definition Mismatch error.

Method 3

1. Use the Btrieve utilities to get the record length and index information.
2. Add filler to the end of the record as needed so the length matches.
3. Uncheck "Check Definition" in the Database setup.

Then use Ctrl-G to look at the data, and keep tweaking it til it looks right. This requires some  knowledge of underlying data formats (something us old COBOL programmers do know!). You can set up "filler" fields that are alpha, which makes it easier to see the content.

If the record contains "variable data" it's a bit more difficult. However, old files don't have that so much. And if it is there, it will be at the end of the record.


Best regards,

Arch

On Mon, Mar 27, 2017 at 4:16 PM, Lado Wali <ladowali@...> wrote:
Can Some one help me read a structure of a Btrieve file from the attached report and advise the method of reading it so I can do for other files.

Thanks
Lado











Re: Mail Send Error -83

Govert Schipper
 

Hi Graham,


I have never seen this error message before, maybe there is a problem with the smtp-server.

Do you get this message for every mail you send, or only for some? Does the mail have an attachment? 

Can you try to send a message to the same server using your regular mail client?


Govert




Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Graham White <graham.white@...>
Verzonden: woensdag 29 maart 2017 02:33
Aan: main@magicu-l.groups.io
Onderwerp: [magicu-l] Mail Send Error -83
 

Hi,


We are receiving a MailError -83 Failed to write to data source when doing a Mailsend, does anyone have any idea exactly what this means?

 

Graham White | Software Developer | Graham.White@... |
EC Credit Control | www.eccreditcontrol.com |
This e-mail message and any attachments are confidential to EC Credit Control and subject to legal privilege. If you have received this e-mail in error, please advise the sender immediately and destroy the message and any attachments.  If you are not the intended recipient you are notified that any use, distribution, amendment, copying or any action taken or omitted to be taken in reliance of this message or attachments is prohibited.

 


Re: How to read Structure of a Btrieve File

Govert Schipper
 

Lado,


If you send me your export file from version 5, I will be happy to convert it to version 8 and than 9 for you.


Govert




Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Lado Wali <ladowali@...>
Verzonden: dinsdag 28 maart 2017 17:38
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] How to read Structure of a Btrieve File
 
Thanks Govert. I'll have to find version 8 first. I believe, I have ver 9 but not 8.

Regards,
Lado
 

On Tue, Mar 28, 2017 at 11:10 AM, Govert Schipper <govertschipper@...> wrote:

Lado,


You don't have to migrate the complete application, just the data repository (and maybe the models if you like). Just use the Magic export function from version 5. Than import this into a new versio 8 application and repeat these steps. Than import into version 9 and repeat again. Finally import in uniPaaS and use the AddOn utility DDFMaker.


Govert




Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Lado Wali <ladowali@...>
Verzonden: dinsdag 28 maart 2017 16:25

Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] How to read Structure of a Btrieve File
 
We are currently using uniPaaS 1.9d and the dos base application is sitting in Magic 5.03c. The dos base magic application is a engineering application and it is already re-written in Labview but because dosbase application has many applications with hundreds of tables, it require to read the data externally to move to the labview mysql database.

What is the method to convert Magic 5.03c application to uniPaaS 1.9d so I can create DDF files. Can some one please write the steps so I can try that.

Thanks
Lado
 

On Tue, Mar 28, 2017 at 9:16 AM, Rob Westland <magicrob@...> wrote:
Hi Lado,

I think the easiest way is to export the data repository from that old dos program and import it in Magic 8, then go to Magic 9 and to XPA.

Rob


Op 28-3-2017 om 14:49 schreef Lado Wali:
Govert,

Ok, actually we have very old magic application in dos base and it is using bunch of .dat files. I found that I can see the definition in the old dos base magic. The software person wanted to read the data from all those files through the program. Please advise if it can be done through DDF and how to create DDF files out of the old dos base magic and then how to read DDF files?

Thanks
Lado


On Tue, Mar 28, 2017 at 7:10 AM, Govert Schipper <govertschipper@...> wrote:

Lado,


The only thing you know for sure is the total record length (1620 bytes) and that the first field is an integer of 2 bytes, probably just a sequence number. The rest of the record you can try to determine by looking at the contents of the remaining 1618 bytes.


Was this file created/populate using Magic? Do you have DDF files? Than you can view the record structure using Pervasive Control Center.


Govert




Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Lado Wali <ladowali@...>
Verzonden: maandag 27 maart 2017 23:58
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] How to read Structure of a Btrieve File
 
File Statistics for c:\downloads\aaa\aa1\gsfil053.dat

File Version = 9.50
Page Size = 2048
Page Preallocation = No
Key Only = No
Extended = No

Total Number of Records = 30
Record Length = 1620
Record Compression = No
Page Compression = No
Variable Records = No

Available Linked Duplicate Keys = 0
Balanced Key = No
Log Key = SYSKEY
System Data = Yes
   SYSKEY Status = Present
Total Number of Keys = 1
Total Number of Segments = 1

Key         Position        Type            Null Values*               ACS
    Segment          Length           Flags              Unique Values
  0    1         1       2  Integer      M      --                30    --

Legend:
 < = Descending Order
 D = Duplicates Allowed
 I = Case Insensitive
 M = Modifiable
 R = Repeat Duplicate
 A = Any Segment (Manual)
 L = All Segments (Null)
 * = The values in this column are hexadecimal.
?? = Unknown
-- = Not Specified


Arch,

From the above report, it looks like one field of integer and I tried putting one field with numeric from 1 to 10 digits and tried opening bit it does not open the file. Do you guess something else?

Thanks
Lado




On Mon, Mar 27, 2017 at 5:07 PM, Arch <Arch.Lineberger@...> wrote:
Btrieve only knows the file length and key position/type. I'm afraid - short of some utility - you will have to parse the fields as described to specify the fields to Magic.

Best regards,

Arch

On Mon, Mar 27, 2017 at 5:00 PM, Lado Wali <ladowali@...> wrote:
Arch,

I do not have any file structure for ctrl+G but have many btrieve files that I need to open.

I am trying right now with Pervasive utility if I can find some information to create the definition.

Thx


On Mon, Mar 27, 2017 at 4:34 PM, Arch <Arch.Lineberger@...> wrote:
Lado,

From a long time ago by Steve Blank, I believe:

Method 1

1 – Ctl+G in the data dictionary to find the file (Definition Mismatch)

2 - Uncheck "Check definition" and "Check index" and "Change tables in Studio" in the relevant Database Properties.

3 – Add a field at the end of the file in question.

4 – Exit the file and arrow-up, DO NOT CONVERT

5 – Remove the field just added

6 – Exit the file and arrow-up, DO CONVERT

7 – Database/Properties, Check Definition = Yes

Chances are, at some point in the record, the fields start looking funky. That is where your mismatch is. Generally a field was added, but the data not converted. Usually the easiest fix is to delete the added field, so everything lines up. Then add the field again, and make sure Magic can reformat the file (or that you have a program to do the reformat). 

Method 2

Use the Pervasive utility called DDF Builder. In addition to showing you the overall record length and index structure that the Maintenance utilities display, DDF Builder will also display actual data to help you figure out where one non-indexed column ends and the next begins.

On the downside, DDF Builder is not terribly intuitive to use and is really a 95%-completed product. In the end however, Magic's Definition Mismatch error can only compare overall record length and index structure, so the aforementioned maintenance utilities will reveal enough information to at least solve the Definition Mismatch error.

Method 3

1. Use the Btrieve utilities to get the record length and index information.
2. Add filler to the end of the record as needed so the length matches.
3. Uncheck "Check Definition" in the Database setup.

Then use Ctrl-G to look at the data, and keep tweaking it til it looks right. This requires some  knowledge of underlying data formats (something us old COBOL programmers do know!). You can set up "filler" fields that are alpha, which makes it easier to see the content.

If the record contains "variable data" it's a bit more difficult. However, old files don't have that so much. And if it is there, it will be at the end of the record.


Best regards,

Arch

On Mon, Mar 27, 2017 at 4:16 PM, Lado Wali <ladowali@...> wrote:
Can Some one help me read a structure of a Btrieve file from the attached report and advise the method of reading it so I can do for other files.

Thanks
Lado










Re: Unipaas 1.9H connection to TFS 2015

Jakes du Preez <dupreez.jakes@...>
 

If you mean the version history... it will belost, yes. I came across these migration walk-through documents that might help if you wish to accomplish that.




On Wed, Mar 29, 2017 at 3:50 AM, katreen_naredo via Groups.Io <katreen_naredo@...> wrote:

Hi Jakes,


We tried this option and it worked. However, if we pushed through with this, we will not be able to import the other versions stored in the VSS (for the project) to TFS, right?



Re: Unipaas 1.9H connection to TFS 2015

katreen_naredo@...
 

Hi Jakes,


We tried this option and it worked. However, if we pushed through with this, we will not be able to import the other versions stored in the VSS (for the project) to TFS, right?


Mail Send Error -83

Graham White
 

Hi,


We are receiving a MailError -83 Failed to write to data source when doing a Mailsend, does anyone have any idea exactly what this means?

 

Graham White | Software Developer | Graham.White@... |
EC Credit Control | www.eccreditcontrol.com |
This e-mail message and any attachments are confidential to EC Credit Control and subject to legal privilege. If you have received this e-mail in error, please advise the sender immediately and destroy the message and any attachments.  If you are not the intended recipient you are notified that any use, distribution, amendment, copying or any action taken or omitted to be taken in reliance of this message or attachments is prohibited.

 


Re: How to read Structure of a Btrieve File

Lado Wali
 

Thanks Govert. I'll have to find version 8 first. I believe, I have ver 9 but not 8.

Regards,
Lado
 

On Tue, Mar 28, 2017 at 11:10 AM, Govert Schipper <govertschipper@...> wrote:

Lado,


You don't have to migrate the complete application, just the data repository (and maybe the models if you like). Just use the Magic export function from version 5. Than import this into a new versio 8 application and repeat these steps. Than import into version 9 and repeat again. Finally import in uniPaaS and use the AddOn utility DDFMaker.


Govert




Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Lado Wali <ladowali@...>
Verzonden: dinsdag 28 maart 2017 16:25

Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] How to read Structure of a Btrieve File
 
We are currently using uniPaaS 1.9d and the dos base application is sitting in Magic 5.03c. The dos base magic application is a engineering application and it is already re-written in Labview but because dosbase application has many applications with hundreds of tables, it require to read the data externally to move to the labview mysql database.

What is the method to convert Magic 5.03c application to uniPaaS 1.9d so I can create DDF files. Can some one please write the steps so I can try that.

Thanks
Lado
 

On Tue, Mar 28, 2017 at 9:16 AM, Rob Westland <magicrob@...> wrote:
Hi Lado,

I think the easiest way is to export the data repository from that old dos program and import it in Magic 8, then go to Magic 9 and to XPA.

Rob


Op 28-3-2017 om 14:49 schreef Lado Wali:
Govert,

Ok, actually we have very old magic application in dos base and it is using bunch of .dat files. I found that I can see the definition in the old dos base magic. The software person wanted to read the data from all those files through the program. Please advise if it can be done through DDF and how to create DDF files out of the old dos base magic and then how to read DDF files?

Thanks
Lado


On Tue, Mar 28, 2017 at 7:10 AM, Govert Schipper <govertschipper@...> wrote:

Lado,


The only thing you know for sure is the total record length (1620 bytes) and that the first field is an integer of 2 bytes, probably just a sequence number. The rest of the record you can try to determine by looking at the contents of the remaining 1618 bytes.


Was this file created/populate using Magic? Do you have DDF files? Than you can view the record structure using Pervasive Control Center.


Govert




Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Lado Wali <ladowali@...>
Verzonden: maandag 27 maart 2017 23:58
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] How to read Structure of a Btrieve File
 
File Statistics for c:\downloads\aaa\aa1\gsfil053.dat

File Version = 9.50
Page Size = 2048
Page Preallocation = No
Key Only = No
Extended = No

Total Number of Records = 30
Record Length = 1620
Record Compression = No
Page Compression = No
Variable Records = No

Available Linked Duplicate Keys = 0
Balanced Key = No
Log Key = SYSKEY
System Data = Yes
   SYSKEY Status = Present
Total Number of Keys = 1
Total Number of Segments = 1

Key         Position        Type            Null Values*               ACS
    Segment          Length           Flags              Unique Values
  0    1         1       2  Integer      M      --                30    --

Legend:
 < = Descending Order
 D = Duplicates Allowed
 I = Case Insensitive
 M = Modifiable
 R = Repeat Duplicate
 A = Any Segment (Manual)
 L = All Segments (Null)
 * = The values in this column are hexadecimal.
?? = Unknown
-- = Not Specified


Arch,

From the above report, it looks like one field of integer and I tried putting one field with numeric from 1 to 10 digits and tried opening bit it does not open the file. Do you guess something else?

Thanks
Lado




On Mon, Mar 27, 2017 at 5:07 PM, Arch <Arch.Lineberger@...> wrote:
Btrieve only knows the file length and key position/type. I'm afraid - short of some utility - you will have to parse the fields as described to specify the fields to Magic.

Best regards,

Arch

On Mon, Mar 27, 2017 at 5:00 PM, Lado Wali <ladowali@...> wrote:
Arch,

I do not have any file structure for ctrl+G but have many btrieve files that I need to open.

I am trying right now with Pervasive utility if I can find some information to create the definition.

Thx


On Mon, Mar 27, 2017 at 4:34 PM, Arch <Arch.Lineberger@...> wrote:
Lado,

From a long time ago by Steve Blank, I believe:

Method 1

1 – Ctl+G in the data dictionary to find the file (Definition Mismatch)

2 - Uncheck "Check definition" and "Check index" and "Change tables in Studio" in the relevant Database Properties.

3 – Add a field at the end of the file in question.

4 – Exit the file and arrow-up, DO NOT CONVERT

5 – Remove the field just added

6 – Exit the file and arrow-up, DO CONVERT

7 – Database/Properties, Check Definition = Yes

Chances are, at some point in the record, the fields start looking funky. That is where your mismatch is. Generally a field was added, but the data not converted. Usually the easiest fix is to delete the added field, so everything lines up. Then add the field again, and make sure Magic can reformat the file (or that you have a program to do the reformat). 

Method 2

Use the Pervasive utility called DDF Builder. In addition to showing you the overall record length and index structure that the Maintenance utilities display, DDF Builder will also display actual data to help you figure out where one non-indexed column ends and the next begins.

On the downside, DDF Builder is not terribly intuitive to use and is really a 95%-completed product. In the end however, Magic's Definition Mismatch error can only compare overall record length and index structure, so the aforementioned maintenance utilities will reveal enough information to at least solve the Definition Mismatch error.

Method 3

1. Use the Btrieve utilities to get the record length and index information.
2. Add filler to the end of the record as needed so the length matches.
3. Uncheck "Check Definition" in the Database setup.

Then use Ctrl-G to look at the data, and keep tweaking it til it looks right. This requires some  knowledge of underlying data formats (something us old COBOL programmers do know!). You can set up "filler" fields that are alpha, which makes it easier to see the content.

If the record contains "variable data" it's a bit more difficult. However, old files don't have that so much. And if it is there, it will be at the end of the record.


Best regards,

Arch

On Mon, Mar 27, 2017 at 4:16 PM, Lado Wali <ladowali@...> wrote:
Can Some one help me read a structure of a Btrieve file from the attached report and advise the method of reading it so I can do for other files.

Thanks
Lado










Re: How to read Structure of a Btrieve File

Lado Wali
 

Thanks Keith, certainly this will help.

Best Regards,
Lado



On Tue, Mar 28, 2017 at 11:12 AM, Keith Canniff <kcanniff@...> wrote:

Lado,

 

This should do it (actually takes longer to write this up than do it):

 

  1. Export ‘Files’ from Magic 5.x
  2. Create a new application in Magic 8 (Settings/Applications)
  3. Repository Export/Import
  4. Import 5.xx 4.xx, which should give you a file repository in v8
  5. Go to the table repository, make sure your cursor is above the first table in the repository and press Ctrl+D (Options/DDF Make). This will create four DDF files in your current default folder (press Ctrl+Z and it will exit to a command line there).
  6. Put these files in the folder that contains your data files
  7. Go into PCC, create a new database (give a shorter name with no spaces just to be safe. I keep mine under 10 characters normally but that’s just me) pointing to this folder.
  8. In PCC go into that database, open up the tables folder and you should see all your tables. If you double click on any table that has data, you should see that data appear in the right frame in PCC. At least this will tell you that the DDFs and the data match up.

 

If you don’t need anything else, you can stop here. Any application that uses ODBC should now be able to access those tables. If you need this from inside of UP 1.9, continue with the steps below.

 

Just using the DOS files in UP via SQL (relational engine)

  1. Open UP 1.9
  2. Goto Options/Settings/Databases
  3. Create a new database where the “Database Name” is set to the database name you created in PCC
  4. Set the DBMS name to “Pervasive”. Click OK
  5. Open your application
  6. Goto the Data Repository and make sure your cursor is above the first entry in the table
  7. Select Options/Get Definition
  8. Select the database name you created in #3 above
  9. For “Tag data sources”, select either ‘All’ if you want all of them, or “Several” to pick from a list
  10. Once you press Ok, UP will generate the tables and add them to your data repository.
  11. Browser your tables to see if you can read them.

 

If you’re using traditional Btrieve:

  1. From Magic v8, Export the data repository
  2. In Magic 9, create an application and import the above export (Options/Settings/Export Import
  3. Now do an Options/Settings/Export Import/Export for Version 10.x
  4. Open Up 1.9
  5. Press Help and search for “V9Converter” This will give you the instructions to run the command line converter to convert the v9 export you just created to something UP can read
  6. Once the above step is complete, just import the file created and you’ll have your new file definitions in UP.

 

Hope this helps.

 

Keith Canniff
President and CTO
IntegrateOne LLC
www.integrateone.com
678-485-8665


 

 

 

From: main@magicu-l.groups.io [mailto:main@....io] On Behalf Of Lado Wali
Sent: Tuesday, March 28, 2017 7:25 AM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] How to read Structure of a Btrieve File

 

We are currently using uniPaaS 1.9d and the dos base application is sitting in Magic 5.03c. The dos base magic application is a engineering application and it is already re-written in Labview but because dosbase application has many applications with hundreds of tables, it require to read the data externally to move to the labview mysql database.

 

What is the method to convert Magic 5.03c application to uniPaaS 1.9d so I can create DDF files. Can some one please write the steps so I can try that.

 

Thanks

Lado

 

 

On Tue, Mar 28, 2017 at 9:16 AM, Rob Westland <magicrob@...> wrote:

Hi Lado,

I think the easiest way is to export the data repository from that old dos program and import it in Magic 8, then go to Magic 9 and to XPA.

Rob

Op 28-3-2017 om 14:49 schreef Lado Wali:

Govert,

 

Ok, actually we have very old magic application in dos base and it is using bunch of .dat files. I found that I can see the definition in the old dos base magic. The software person wanted to read the data from all those files through the program. Please advise if it can be done through DDF and how to create DDF files out of the old dos base magic and then how to read DDF files?

 

Thanks

Lado

 

 

On Tue, Mar 28, 2017 at 7:10 AM, Govert Schipper <govertschipper@...> wrote:

Lado,

 

The only thing you know for sure is the total record length (1620 bytes) and that the first field is an integer of 2 bytes, probably just a sequence number. The rest of the record you can try to determine by looking at the contents of the remaining 1618 bytes.

 

Was this file created/populate using Magic? Do you have DDF files? Than you can view the record structure using Pervasive Control Center.

 

Govert

 


Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Lado Wali <ladowali@...>
Verzonden: maandag 27 maart 2017 23:58
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] How to read Structure of a Btrieve File

 

File Statistics for c:\downloads\aaa\aa1\gsfil053.dat

 

File Version = 9.50

Page Size = 2048

Page Preallocation = No

Key Only = No

Extended = No

 

Total Number of Records = 30

Record Length = 1620

Record Compression = No

Page Compression = No

Variable Records = No

 

Available Linked Duplicate Keys = 0

Balanced Key = No

Log Key = SYSKEY

System Data = Yes

   SYSKEY Status = Present

Total Number of Keys = 1

Total Number of Segments = 1

 

Key         Position        Type            Null Values*               ACS

    Segment          Length           Flags              Unique Values

  0    1         1       2  Integer      M      --                30    --

 

Legend:

 < = Descending Order

 D = Duplicates Allowed

 I = Case Insensitive

 M = Modifiable

 R = Repeat Duplicate

 A = Any Segment (Manual)

 L = All Segments (Null)

 * = The values in this column are hexadecimal.

?? = Unknown

-- = Not Specified

 

 

Arch,

 

From the above report, it looks like one field of integer and I tried putting one field with numeric from 1 to 10 digits and tried opening bit it does not open the file. Do you guess something else?

 

Thanks

Lado

 

 

 

 

On Mon, Mar 27, 2017 at 5:07 PM, Arch <Arch.Lineberger@...> wrote:

Btrieve only knows the file length and key position/type. I'm afraid - short of some utility - you will have to parse the fields as described to specify the fields to Magic.


Best regards,

 

Arch

 

On Mon, Mar 27, 2017 at 5:00 PM, Lado Wali <ladowali@...> wrote:

Arch,

 

I do not have any file structure for ctrl+G but have many btrieve files that I need to open.

 

I am trying right now with Pervasive utility if I can find some information to create the definition.

 

Thx

 

 

On Mon, Mar 27, 2017 at 4:34 PM, Arch <Arch.Lineberger@...> wrote:

Lado,

 

From a long time ago by Steve Blank, I believe:

Method 1

1 – Ctl+G in the data dictionary to find the file (Definition Mismatch)

2 - Uncheck "Check definition" and "Check index" and "Change tables in Studio" in the relevant Database Properties.

3 – Add a field at the end of the file in question.

4 – Exit the file and arrow-up, DO NOT CONVERT

5 – Remove the field just added

6 – Exit the file and arrow-up, DO CONVERT

7 – Database/Properties, Check Definition = Yes

Chances are, at some point in the record, the fields start looking funky. That is where your mismatch is. Generally a field was added, but the data not converted. Usually the easiest fix is to delete the added field, so everything lines up. Then add the field again, and make sure Magic can reformat the file (or that you have a program to do the reformat). 

Method 2

Use the Pervasive utility called DDF Builder. In addition to showing you the overall record length and index structure that the Maintenance utilities display, DDF Builder will also display actual data to help you figure out where one non-indexed column ends and the next begins.

On the downside, DDF Builder is not terribly intuitive to use and is really a 95%-completed product. In the end however, Magic's Definition Mismatch error can only compare overall record length and index structure, so the aforementioned maintenance utilities will reveal enough information to at least solve the Definition Mismatch error.

Method 3

1. Use the Btrieve utilities to get the record length and index information.
2. Add filler to the end of the record as needed so the length matches.
3. Uncheck "Check Definition" in the Database setup.

Then use Ctrl-G to look at the data, and keep tweaking it til it looks right. This requires some  knowledge of underlying data formats (something us old COBOL programmers do know!). You can set up "filler" fields that are alpha, which makes it easier to see the content.

If the record contains "variable data" it's a bit more difficult. However, old files don't have that so much. And if it is there, it will be at the end of the record.


Best regards,

 

Arch

 

On Mon, Mar 27, 2017 at 4:16 PM, Lado Wali <ladowali@...> wrote:

Can Some one help me read a structure of a Btrieve file from the attached report and advise the method of reading it so I can do for other files.

 

Thanks

Lado

 

 

 

 

 

 

 

 


Virus-free. www.avast.com



Re: How to read Structure of a Btrieve File

Keith Canniff
 

Lado,

 

This should do it (actually takes longer to write this up than do it):

 

  1. Export ‘Files’ from Magic 5.x
  2. Create a new application in Magic 8 (Settings/Applications)
  3. Repository Export/Import
  4. Import 5.xx 4.xx, which should give you a file repository in v8
  5. Go to the table repository, make sure your cursor is above the first table in the repository and press Ctrl+D (Options/DDF Make). This will create four DDF files in your current default folder (press Ctrl+Z and it will exit to a command line there).
  6. Put these files in the folder that contains your data files
  7. Go into PCC, create a new database (give a shorter name with no spaces just to be safe. I keep mine under 10 characters normally but that’s just me) pointing to this folder.
  8. In PCC go into that database, open up the tables folder and you should see all your tables. If you double click on any table that has data, you should see that data appear in the right frame in PCC. At least this will tell you that the DDFs and the data match up.

 

If you don’t need anything else, you can stop here. Any application that uses ODBC should now be able to access those tables. If you need this from inside of UP 1.9, continue with the steps below.

 

Just using the DOS files in UP via SQL (relational engine)

  1. Open UP 1.9
  2. Goto Options/Settings/Databases
  3. Create a new database where the “Database Name” is set to the database name you created in PCC
  4. Set the DBMS name to “Pervasive”. Click OK
  5. Open your application
  6. Goto the Data Repository and make sure your cursor is above the first entry in the table
  7. Select Options/Get Definition
  8. Select the database name you created in #3 above
  9. For “Tag data sources”, select either ‘All’ if you want all of them, or “Several” to pick from a list
  10. Once you press Ok, UP will generate the tables and add them to your data repository.
  11. Browser your tables to see if you can read them.

 

If you’re using traditional Btrieve:

  1. From Magic v8, Export the data repository
  2. In Magic 9, create an application and import the above export (Options/Settings/Export Import
  3. Now do an Options/Settings/Export Import/Export for Version 10.x
  4. Open Up 1.9
  5. Press Help and search for “V9Converter” This will give you the instructions to run the command line converter to convert the v9 export you just created to something UP can read
  6. Once the above step is complete, just import the file created and you’ll have your new file definitions in UP.

 

Hope this helps.

 

Keith Canniff
President and CTO
IntegrateOne LLC
www.integrateone.com
678-485-8665


 

 

 

From: main@magicu-l.groups.io [mailto:main@magicu-l.groups.io] On Behalf Of Lado Wali
Sent: Tuesday, March 28, 2017 7:25 AM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] How to read Structure of a Btrieve File

 

We are currently using uniPaaS 1.9d and the dos base application is sitting in Magic 5.03c. The dos base magic application is a engineering application and it is already re-written in Labview but because dosbase application has many applications with hundreds of tables, it require to read the data externally to move to the labview mysql database.

 

What is the method to convert Magic 5.03c application to uniPaaS 1.9d so I can create DDF files. Can some one please write the steps so I can try that.

 

Thanks

Lado

 

 

On Tue, Mar 28, 2017 at 9:16 AM, Rob Westland <magicrob@...> wrote:

Hi Lado,

I think the easiest way is to export the data repository from that old dos program and import it in Magic 8, then go to Magic 9 and to XPA.

Rob

Op 28-3-2017 om 14:49 schreef Lado Wali:

Govert,

 

Ok, actually we have very old magic application in dos base and it is using bunch of .dat files. I found that I can see the definition in the old dos base magic. The software person wanted to read the data from all those files through the program. Please advise if it can be done through DDF and how to create DDF files out of the old dos base magic and then how to read DDF files?

 

Thanks

Lado

 

 

On Tue, Mar 28, 2017 at 7:10 AM, Govert Schipper <govertschipper@...> wrote:

Lado,

 

The only thing you know for sure is the total record length (1620 bytes) and that the first field is an integer of 2 bytes, probably just a sequence number. The rest of the record you can try to determine by looking at the contents of the remaining 1618 bytes.

 

Was this file created/populate using Magic? Do you have DDF files? Than you can view the record structure using Pervasive Control Center.

 

Govert

 


Van: main@magicu-l.groups.io <main@magicu-l.groups.io> namens Lado Wali <ladowali@...>
Verzonden: maandag 27 maart 2017 23:58
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] How to read Structure of a Btrieve File

 

File Statistics for c:\downloads\aaa\aa1\gsfil053.dat

 

File Version = 9.50

Page Size = 2048

Page Preallocation = No

Key Only = No

Extended = No

 

Total Number of Records = 30

Record Length = 1620

Record Compression = No

Page Compression = No

Variable Records = No

 

Available Linked Duplicate Keys = 0

Balanced Key = No

Log Key = SYSKEY

System Data = Yes

   SYSKEY Status = Present

Total Number of Keys = 1

Total Number of Segments = 1

 

Key         Position        Type            Null Values*               ACS

    Segment          Length           Flags              Unique Values

  0    1         1       2  Integer      M      --                30    --

 

Legend:

 < = Descending Order

 D = Duplicates Allowed

 I = Case Insensitive

 M = Modifiable

 R = Repeat Duplicate

 A = Any Segment (Manual)

 L = All Segments (Null)

 * = The values in this column are hexadecimal.

?? = Unknown

-- = Not Specified

 

 

Arch,

 

From the above report, it looks like one field of integer and I tried putting one field with numeric from 1 to 10 digits and tried opening bit it does not open the file. Do you guess something else?

 

Thanks

Lado

 

 

 

 

On Mon, Mar 27, 2017 at 5:07 PM, Arch <Arch.Lineberger@...> wrote:

Btrieve only knows the file length and key position/type. I'm afraid - short of some utility - you will have to parse the fields as described to specify the fields to Magic.


Best regards,

 

Arch

 

On Mon, Mar 27, 2017 at 5:00 PM, Lado Wali <ladowali@...> wrote:

Arch,

 

I do not have any file structure for ctrl+G but have many btrieve files that I need to open.

 

I am trying right now with Pervasive utility if I can find some information to create the definition.

 

Thx

 

 

On Mon, Mar 27, 2017 at 4:34 PM, Arch <Arch.Lineberger@...> wrote:

Lado,

 

From a long time ago by Steve Blank, I believe:

Method 1

1 – Ctl+G in the data dictionary to find the file (Definition Mismatch)

2 - Uncheck "Check definition" and "Check index" and "Change tables in Studio" in the relevant Database Properties.

3 – Add a field at the end of the file in question.

4 – Exit the file and arrow-up, DO NOT CONVERT

5 – Remove the field just added

6 – Exit the file and arrow-up, DO CONVERT

7 – Database/Properties, Check Definition = Yes

Chances are, at some point in the record, the fields start looking funky. That is where your mismatch is. Generally a field was added, but the data not converted. Usually the easiest fix is to delete the added field, so everything lines up. Then add the field again, and make sure Magic can reformat the file (or that you have a program to do the reformat). 

Method 2

Use the Pervasive utility called DDF Builder. In addition to showing you the overall record length and index structure that the Maintenance utilities display, DDF Builder will also display actual data to help you figure out where one non-indexed column ends and the next begins.

On the downside, DDF Builder is not terribly intuitive to use and is really a 95%-completed product. In the end however, Magic's Definition Mismatch error can only compare overall record length and index structure, so the aforementioned maintenance utilities will reveal enough information to at least solve the Definition Mismatch error.

Method 3

1. Use the Btrieve utilities to get the record length and index information.
2. Add filler to the end of the record as needed so the length matches.
3. Uncheck "Check Definition" in the Database setup.

Then use Ctrl-G to look at the data, and keep tweaking it til it looks right. This requires some  knowledge of underlying data formats (something us old COBOL programmers do know!). You can set up "filler" fields that are alpha, which makes it easier to see the content.

If the record contains "variable data" it's a bit more difficult. However, old files don't have that so much. And if it is there, it will be at the end of the record.


Best regards,

 

Arch

 

On Mon, Mar 27, 2017 at 4:16 PM, Lado Wali <ladowali@...> wrote:

Can Some one help me read a structure of a Btrieve file from the attached report and advise the method of reading it so I can do for other files.

 

Thanks

Lado

 

 

 

 

 

 

 

 


Virus-free. www.avast.com

11621 - 11640 of 195966