Página 1 de 1

How to set the table for a tDbfBrowse?

Publicado: Vie Jul 19, 2019 12:15 am
por DC
Hi,

Can someone forward instructions about how to simply attach a table to tDBFBrowse or tCDXDataSource or tDBFBrowse, or whatever we're supposed to use?

I've been looking at the c:\Xailer6\Samples\Browses\BrwEdit sample for hours, and can't figure out how they connect the actual table to the Browse component.

There's an aCols array in the tDBFBrowse that contains the fields, but how does it get populated?

I tried setting the cName in an the TDbfDataset, setting the cConnect property in TCdxDataSource, and setting oDataSource in TDbfDataSet to the name of the TCdxDataSource, and all sorts of other things. But I can't figure out how to set these, and then connect it to a tDbfBrowse.

And yes, I've read the Help, and saw there's a SetDBF method. But I want to point to the table directly in the IDE, in a separate project.

Is there some step by step instructions about how to do this?

Re: How to set the table for a tDbfBrowse?

Publicado: Vie Jul 19, 2019 11:16 am
por ignacio


BTW, to see a sample of using TDbfBrowse instead of TDbBrowsse (NO Datacontrols), see this sample: samples/Datacontrols/DbfData3

Regards,

Re: How to set the table for a tDbfBrowse?

Publicado: Vie Jul 19, 2019 3:42 pm
por DC
Ignacio, you understood. That's exactly what I was for, thanks.


Regards,

DC
ignacio escribió:

BTW, to see a sample of using TDbfBrowse instead of TDbBrowsse (NO Datacontrols), see this sample: samples/Datacontrols/DbfData3

Regards,

Re: How to set the table for a tDbfBrowse?

Publicado: Vie Jul 19, 2019 10:03 pm
por DC
Edit: 07/19/2019 EST, 9:05 pm

Hi,

I'm getting a different result, on my home desktop. It's working fine, there. It's 8.1 Windows. The laptop, where I have the problems described below, is Windows 10 with an SSD drive.

If you have any suggestions, let me know. Otherwise, we can close this problem thread, and I'll work off my desktop. Also, I'll try the Portable flash drive version, on another PC in a few days.

Thanks for your assistance Ignacio, I think we're fine, except for the laptop.


Regards,

DC

************************************************************************************************************************************************************************************


Ok, I followed along, and a few problems:

1) Starting around 0:48, where you locate the folder and DBF to assign to the oConnect property, in the CDXDatasource, it won't retain my setting after exiting from the table editor.

In other words, after I navigate to the table I want and after exiting, it disappears. I have to type in the folder and table directly, in order to persist the table in oConnect.


2) The oDataSet property in the tDbBBrowse (around 1:55) doesn't show a picklist of current datasets. I have to type in oDbfDataSet1 directly.


3) Back in the TDbfDataSet instance oDbfDataset, around 2:01 - If I try to set lOpen to T, there's an open error regarding the selected table.

I tried Exiting from Xailer, checking to make sure the table isn't opened elsewhere, and running the project again. Same result.


This is just a simple Edit routine for the table in question. I want to keep this separate from the main module that uses the table. But will be sharing that project that uses this table, with the Xailer community.




ignacio escribió:

BTW, to see a sample of using TDbfBrowse instead of TDbBrowsse (NO Datacontrols), see this sample: samples/Datacontrols/DbfData3

Regards,

Re: How to set the table for a tDbfBrowse?

Publicado: Lun Jul 22, 2019 10:07 am
por ignacio
1) Starting around 0:48, where you locate the folder and DBF to assign to the oConnect property, in the CDXDatasource, it won't retain my setting after exiting from the table editor.


Here is working fine. The directory used is not the one of the possible open DBF file, but of the last directory selected through the 'Search directory' button.

BTW, the default the cConnect property is '.', which means the application directory. For example: a the directory DATA from the App directory will be: .\DATA
2) The oDataSet property in the tDbBBrowse (around 1:55) doesn't show a picklist of current datasets. I have to type in oDbfDataSet1 directly.
Really strange. I'm afraid I can not reproduce it, sorry. Please send me the sample using the menu option Project->Export project.
3) Back in the TDbfDataSet instance oDbfDataset, around 2:01 - If I try to set lOpen to T, there's an open error regarding the selected table.
Surely the file is blocked by another app. A common error is to open the file in exclusive mode on the IDE and then try to run the App. Since the table is open in exclusive, your App will only work when executed outside the IDE.

Try to delete the file manually from the File Explorer. If you can't, then surely is blocked by another App. open the Task Manager and close that App.

Regards,

Re: How to set the table for a tDbfBrowse?

Publicado: Sab Jul 27, 2019 1:13 am
por DC
Hi,

I added a field SAVEHTML to the table, and then unsuccessfully tried to add a column. The entire browse truncated to only 2 columns, after trying to add a new column.

I happened several times. So I went into the source folder, Edited frm_Config_Edit.xfm, and cloned another boolean field. It mostly worked fine, except the new column won't show a picklist of True/False.

More importantly, I also put the '.' representing the application direction into the oConnect property. But then suddenly, all of the data was no longer visible. The columns were still there, but the table data would no longer show up in the browse.

Even after I removed the '.', the data is still not visible.

Same thing if I exit from Xailer, and run the executable.


I confirmed that the data is still there by opening the table elsewhere.

Not sure what happened. I did nothing more, than put in the dot.


Anyway, I'm going to document and post the program that is using this table shortly. It's been very useful to me.


ignacio escribió:
1) Starting around 0:48, where you locate the folder and DBF to assign to the oConnect property, in the CDXDatasource, it won't retain my setting after exiting from the table editor.


Here is working fine. The directory used is not the one of the possible open DBF file, but of the last directory selected through the 'Search directory' button.

BTW, the default the cConnect property is '.', which means the application directory. For example: a the directory DATA from the App directory will be: .\DATA
2) The oDataSet property in the tDbBBrowse (around 1:55) doesn't show a picklist of current datasets. I have to type in oDbfDataSet1 directly.
Really strange. I'm afraid I can not reproduce it, sorry. Please send me the sample using the menu option Project->Export project.
3) Back in the TDbfDataSet instance oDbfDataset, around 2:01 - If I try to set lOpen to T, there's an open error regarding the selected table.
Surely the file is blocked by another app. A common error is to open the file in exclusive mode on the IDE and then try to run the App. Since the table is open in exclusive, your App will only work when executed outside the IDE.

Try to delete the file manually from the File Explorer. If you can't, then surely is blocked by another App. open the Task Manager and close that App.

Regards,

Re: How to set the table for a tDbfBrowse?

Publicado: Lun Ago 05, 2019 10:20 am
por ignacio
Dear Sir,

That code is been working fine por a long time and no one has complain about it I really do not know what you are doing wrong.

To add a column to a TBrowse you just need to use the contextual menu (mouse right click) and then select new column. That's all. The picklist depends on the nEditType property.

If you change the tables path on its cConnect property, all of the dependant tables are closed. You must reopen them again setting lOpen to TRUE.

Regards

Re: How to set the table for a tDbfBrowse?

Publicado: Lun Ago 05, 2019 8:41 pm
por DC
Although I do have complaints, I don't believe that asking for help on a forum constitutes a complaint.

Perhaps I'm stupid or have a mental block, when it comes to these types of problems. It's possible.

Or maybe I'm so used to the automated generation of common components in modern IDEs, that my spoiled brain finds it confusing to have to fill in several components or datasets, for the purpose of Editing a single local table - a type of table that is associated with the Xbase language.

Anyway, everything seems to be working fine now, thanks Ignacio.

When I have a chance, I'll run through this process again with a different table, and annotate a video that explains the kinds of difficulties I had with this. Obviously, I approached this the wrong way, but perhaps a video will clarify why some developers might find the process confusing.

Thanks and regards,

DC
ignacio escribió:Dear Sir,

That code is been working fine por a long time and no one has complain about it I really do not know what you are doing wrong.

To add a column to a TBrowse you just need to use the contextual menu (mouse right click) and then select new column. That's all. The picklist depends on the nEditType property.

If you change the tables path on its cConnect property, all of the dependant tables are closed. You must reopen them again setting lOpen to TRUE.

Regards

Re: How to set the table for a tDbfBrowse?

Publicado: Vie Ago 09, 2019 11:38 am
por ignacio
DC,

Sorry for using the word 'complaint' badly, English is not my first language and sadly I often made that kind of errors. Glad you got it working BTW.

Regards,

Re: How to set the table for a tDbfBrowse?

Publicado: Sab Ago 10, 2019 2:24 pm
por DC
Np, I'll try to get to that video this weekend.

ignacio escribió:DC,

Sorry for using the word 'complaint' badly, English is not my first language and sadly I often made that kind of errors. Glad you got it working BTW.

Regards,