k245 wrote:

Регулярно на форуме появляются темы, смысл которых сводится к тому, чтобы кто-то выполнил работу, которую автор темы не может или не хочет делать.А часто таким авторам даже лень поиск на форуме запустить, чтобы найти ответ на свой вопрос.

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=6578&download=0

А как вы относитесь к халявщикам?

k245
You are rotten, but funny.

I learn a lot from reading your posts smile

I do a lot of searching before I ask, and try a lot of different things.  But sometimes I either cannot find the information, or do not understand it.  There are a lot of you that are very helpful.  I do want you all to know that you are appreciated.

derek wrote:

Hi Sonny,
Please have a look at the attached which is working on my setup (obviously, your full path will depend on where you install it).
Derek.

Derek,

The CopyTo is working, however now it isn't renaming the filename after copy.  So now to use this I will have to go into the script and give file and photos a full path I guess for it to rename accrodingly.

I am using (ExtractFilePath(Application.ExeName) in my script, I guess this quits working as well.

Is there not a way to set the program to just output a different filename instead of sqlite.db in the core settings this way we can still use Save the database file in the folder with the application with a different filename?  Dmitry!!!!!!!!!!????????  smile

I haven't been able to get it to work, because I haven't given it a full path.  I have just been typing Progam.db in the field which allows it to read and write to the database, but loses the CopyTo function because it doesn't know the path to copy the files to.  It makes since, but I do not want to limit where it can be installed and I would like to keep it in the directory with the program.


Thank you all for helping with this.

agusecc wrote:

Hi sdhale29

you can rename sqlite.db with name others, after your project finish..
and you can use  link setting from your project  and set your project to new name database..
see my attachment

Getting it to find, read, and write to the renamed database isn't the problem.  I can set the database filename as you show, and it writes to it fine.  The CopyTo setting on the DBFile and DBImage objects however does not work when doing this.

CDB wrote:

sdHale,

I haven't tried the above code, but it might depend on where you wrote it in the script, for example did you write it in the forms 'onShow ' event or in the body of the script?

You may also have to save the DB name into the Settings.ini as well.

I used the forms Copyto function.  I also tried it in the script Onshow.  Neither worked so I just changed the file back to sqlite.db and it works.

I had the settings file setup correctly because it would write everything to the db.  It just wouldn't copy the file and update the file_filename in the db.

Im really not sure.  I have a pretty complex db with a lot of scripting, but everything works even with the "Program.db" filename except for the CopyTo.

When I change it back to sqlite.db the CopyTo field on the forms works again and so does everything else. 

The above example is just something that I threw together to show that it doesn't work when using a custom db filename.

sibprogsistem wrote:
sdhale29 wrote:
agusecc wrote:

Try this project
maybe help you

Thank you, both for trying.

agusecc, it will work using the filename sqlite.db.  I was trying to use a custom filename for my database.

Form1.SQLConnection.Connected := False;
 Form1.SQLConnection.Params.Add('Database=ExtractFilePath (ParamStr (0))+'Program.db');

My Form1 is renamed to frmMain
I tried the below code and it still doesn't copy the file when saving.

frmMain.SQLConnection.Connected := False;
frmMain.SQLConnection.Params.Add('Database='+ExtractFilePath(ParamStr(0))+'Program.db');
agusecc wrote:

Try this project
maybe help you

Thank you, both for trying.

agusecc, it will work using the filename sqlite.db.  I was trying to use a custom filename for my database.

sibprogsistem wrote:

попробуйте

This still doesn't work for me.  I have tried adding the image and file folder to the directory.

sibprogsistem wrote:

attach your project


Please find the attached project

I guess its just me

10

(15 replies, posted in General)

derek wrote:

Hi sdhale, eyeman,
There are also options for autosizing columns depending on the column header, the data in the column, or both, which might be of help with your project.  Please see the attached (pinched from sdhale - sorry!) for examples.
Derek.


wink Derek y'all are way better at this than I am.  Take over any time.  I appreciate you guys

11

(15 replies, posted in General)

eyeman303 wrote:

Hello sdhale29,
Thanks a lot. You have explained clearly and made my concepts better. Your modifications have made the app work perfectly. One thing I would like to know, whether it is possible to fit the tablegrid header to the tablegrid width, regardless of the number of columns?
Regards,
Eyeman


I have attached a project with two examples.

Form1 is for single column

Form2 is for multiple columns

12

(15 replies, posted in General)

eyeman303 wrote:

One more issue is with tablegrid header. On launching the app, the headings in the tablegrid are skewed towards left and there are extra empty columns on the right. How to fix this?
Regards,
Eyeman

Hello eyeman303,

The header issue is fixed with script, and the error is caused by trying to add items with relationships without selecting the item it is related to.  If you create the project then you must enter the project name before adding the participants.

If you want to add a contribution then you must have selected a Participant name.  If not then it doesn't know which Participant to associate the contribution with.

I have made a couple of modifications to your project to help get you started.

1. I  set two of your database fields to Not Null to prevent your integer error 

2. I enabled the script and put some examples for you to be able to use to fix your column widths.

I hope this helps.

If not then there are awesome people on here that will help you out.  Good luck!!!

I have noticed that if I use any name other than sqlite.db for my database file that CopyTo quits working on both DbFile and DbImage.  I can still save the information to the database, however it does not copy the files.  Can anyone else verify this?  Or is this the way that it is suppose to be?

14

(2 replies, posted in General)

Is there anyway that you can attach your project so that we can take a look at it?  If you can zip it up and upload it.

15

(24 replies, posted in General)

mathmathou wrote:

Hello AD,


Took me some time, but I think I have something for you.


Try this little tool and tell me what you think. Instructions are included inside, just click on the 'question mark' icon, but here they are as well :

  • use SQliteCompare to generate a conversion script

  • start the tool and select your database to convert

  • load the conversion script

  • wait

https://mega.nz/#!tkoklabQ!Sbm6R5jMuVhh … d7GLpadsJU


If this tool works, I could build a version you could distribute with the needed script and instructions to your users, as well as upload it here for all users if you think it is useful.


I had to use Delphi with RAD Studio because I could not find a way to disable Foreign Key Constraints on an attached database with MVD (they are enabled again at the end of the conversion process).
The idea was to build a generic tool, not one with hard-coded instructions that would only work for a specific version and a specific database scheme. This is why the conversion script has to be loaded. But then, if the only thing you have to provide to your users is the conversion script along with the new version of your application, that is simple enough for them to do.


Cheers


Mathias

PS : many things could go wrong, starting with the SQLite connection. Let me known


Mathias,

Would you be willing to share it with me?  The file is gone.

Thank You ehwagner.  I didn't think to try them one at a time, but it works perfectly.

I am trying to create a directory in the users document folder using

procedure Form1_Button5_OnClick (Sender: TObject; var Cancel: boolean);
begin
CreateDir(GetEnvironmentVariable('USERPROFILE')+'\Documents\My Program\Backups');
end;

I have tried several different ways, but cannot accomplish it.  I have no problem writing to the APPDATA Roaming folder, but i want to be able to save some things to my documents for easy access, such as the sqlite.db and the db backups.

Thanks

18

(3 replies, posted in Script)

derek wrote:

Hi Sdhale, CDB,
I guess it depends on how your data is actually being held.
If 'his times' and 'her times' are held as discrete records, then I'd do it by script.
If 'his times' and 'her times' are fields on the same record, then I'd use a calculated field.
See attached for the two options.
Regards,
Derek.

Derek, CDB,

Thank you both.  Derek this is perfect.  Thank you so much for the examples.  I tried a calculated field, but was unsure of the correct way of doing it.  I appreciate it very much.

19

(3 replies, posted in Script)

Hello everyone,

I am trying to convert min to hours and minutes

For example
His Time              Her Time            Total Time
2hr 15min            1hr 30min           3hr 45min

Any help would be appreciated.  I have 'herhr' & 'hermin' and 'hishr' & 'hismin' fields in my db with at totaltime field as well.  I am just not sure how to put it all together.  I can get it to show 3.75, but not 3 45 much less 3hr 45min.

As always any help will be appreciated. 

Thanks

20

(5 replies, posted in Script)

ehwagner wrote:

sdhale29,
Tablegrids are used to display records in a table. So in order to display the dropped files info in a tablegrid you need to create a table to hold the file info and then define a tablegrid to display the records. I created a small project to demonstrate it. I kept Dimitry's code in place and added the table inserts and grid update. I also deleted all records and cleared the tablegrid rows upon Form1 OnShow event. If you need to keep the records in your project, you can remove the procedure.

Thank you ehwagner, I was loading them into a table, but could not get the filenames to show up correctly.  It would list the same filename on all entries.  With your help i figured out how to copy them and get the new file and path name to load correctly.  Thanks again!!!!

21

(5 replies, posted in Script)

Dmitry it works great, but I am having a hard time figuring out how to update the grid with the file information.

22

(5 replies, posted in Script)

DriveSoft wrote:
procedure Form1_OnDropFiles (Sender: TObject; ArrayOfFiles: array of string; X, Y: Integer);
var
    i, c: integer;
    folder: string;
begin
    folder := 'e:\temp\';
    c := Length(ArrayOfFiles)-1;
    for i := 0 to c do
    begin
        CopyFile(ArrayOfFiles[i], folder+ExtractFileName(ArrayOfFiles[i]));
    end;
end;

Thank You Dmitry, i'll give it a try.

23

(5 replies, posted in Script)

Can anyone give me an example on how to use OnDropFiles To Copy the dropped file or files to a folder in a specific directory?  In my case I am trying to drop the files on a tablegrid .

Thank you in advance

24

(9 replies, posted in General)

DriveSoft wrote:

Hello.


Please attach your project, I will test it.

Dimtry,
I just went through and resized everything to be sure that it fit on a 1024x768 monitor.

25

(9 replies, posted in General)

Hello this is still an issue when going to smaller screen lower res monitors.  I used anchors, and they work well when going larger screens or higher resolutions, however when you go to smaller and lower resolution, items will overlap, or move off the page depending on how they are anchored.  Has anyone figured this out yet?