You forgot the attachment.
1 2024-04-09 10:27:45
Re: What is the simplest way to copy a record in a table without coding (5 replies, posted in General)
2 2024-01-05 10:19:55
Re: How To Fix Error Connect Free MySQL Online Service : sql.freedb.tech (4 replies, posted in Script)
MySQL 8.0 supports a new authentication based on improved, stronger SHA256-based password methods.
How To Fix Error Or Custom Script In MVD ?
You can only change it by altering the MySQLsetup security to the legacy setting.
3 2023-11-20 07:26:12
Re: LAB INVOICE (4 replies, posted in General)
You might want it, but I think a little more information would be useful.
4 2023-10-19 07:14:53
Re: Ошибка при подключении к MySQL (4 replies, posted in Russian)
Есть ли разница в номерах версий MySQL? В более поздних выпусках v8 произошли изменения в аспектах безопасности движка. Двигатель Inno по памяти.
Is there a difference in the MySQL version numbers? There was a change in the security aspects of the engine in the later v8 editions.
Inno engine from memory.
5 2023-10-17 09:51:20
Re: SQLQuery with localized date format (25 replies, posted in SQL queries)
Tcoton,
While I would personally read in the country code and then use CASE statements as I wrote above, I think you could do it another way.
First count the length of the string shDate for max_index.
Within a for loop, use dtFormat:= Pos(shDate, ' ')
Then use the loop index, as the position to
Insert(dtFormat, '/', loopIndex);
And perform a similar iteration for the time.
6 2023-09-20 19:01:52
Re: SQLQuery with localized date format (25 replies, posted in SQL queries)
That seems a neater way to do it than my idea Sparrow.
Perhaps TCoton can let us know if that works for his project.
7 2023-09-20 10:43:56
Re: SQLQuery with localized date format (25 replies, posted in SQL queries)
Naturally Sparrow I'm having difficulty getting my registry function to work, but I'll post my general idea.
Registry function.
function ReadReg(thekey, value: string): string;
var
Rg: TRegistry;
begin
//Create the Object
Rg := TRegistry.Create;
with Rg do
begin
RootKey := HKEY_LOCAL_MACHINE;
//False = no write ability
if OpenKey(theKey, false) then
begin
if ValueExists(value) then
//Read the value from the field
Result := Readstring(value)
else
ShowMessage(The value + ' does not exists under ' + theKey);
end
else
//opening the key
ShowMessage('Error opening key : ' + theKey);
CloseKey;
end;
end;
//for demo purposes called by
form1.label1.TagString := ReadReg('\SYSTEM\CurrentControlSet\Control\Nls\Locale', 'Default');
Then from the locale code held in TagString
Do the following SQL Query pseudo code as I can't get the above function to work)
CASE when TagString = 0809 then
format dddd/mm/yyyy
AS thedate
else
CASE when TagString = (whatever the US code is) then
format mm/dddd/yyyy
AS thedate
That is my general idea.
Oh yes, the error the above code keeps throwing is 'Error opening key'. The key exists as I'm looking at in Regedit.
8 2023-09-19 09:33:57
Re: SQLQuery with localized date format (25 replies, posted in SQL queries)
I don't think this is exactly possible using SQLite.
I think the only way to do what you want, is to use MVD to interrogate Windows for the locale code, and then use a SQL iif.... or CASE function to then select the required SQL strftime formatting function.
As an aside I think SQL Server can do what you want.
9 2023-09-09 22:31:14
Re: Procedure ShowRecord (23 replies, posted in Script)
I
How do you like this?
I think Sparrow, where tcoton was having difficulty, was in trying to work out how to get an Image Click to do what a Button Click can do either by script or from the inbuilt functions for ShowRecord etc.
10 2023-06-04 03:15:06
Re: Use current record ID within a scripted Sql Query (17 replies, posted in Script)
A trick you could try, is where you can get the ID save it to a 'form_name.tag' then it is available to you everywhere while that ID is needed.
11 2023-04-26 10:11:41
Re: How can I change the colour of a line in a TChart (4 replies, posted in Script)
Not tested, but see if this works.
ChartLine.Series[0].linepen.color := clBlue;
12 2023-04-14 09:46:29
Re: News about the future of myvdb (35 replies, posted in General)
Any Weblink for DataExpress? I get only some unrelated advertises via google.
13 2023-04-14 09:41:31
Re: Supported MySQL client version with mvd (5 replies, posted in General)
There is the possibility you need to change the Authentication method, I have used v8.0 with MVD some time ago and I had to set the authentication method to the legacy type.
14 2023-01-12 09:40:45
Re: julianday разный результат (5 replies, posted in Russian)
Разница во временной составляющей между кликами?
Или один использует настоящий юлианский календарь, а другой использует григорианский, несмотря на то, что он не должен
Difference in the time component between clicks?
Or one uses the true Julian calendar and the other uses Gregorian, despite it shouldn't
15 2022-12-01 10:03:49
Re: send mail (8 replies, posted in General)
Another option, but not easy to use on a system using MS Exchange is a simple
SendMail('YOUR SERVER NAME','YOUR EMAIL ADDRESS','YOUR EMAIL PASSWORD',PORT # Outlook is on,'RECIPIENT EMAIL ADDRESS','MESSAGE TITLE','MESSAGE TEXT');
A variation on the code in the previous post is below. This is aimed at sending an email on a corporate Outlook server system:
Outlook := CreateOleObject('Outlook.Application');
//vMailItem := Outlook.GetNamespace('MAPI');
vMailItem.Logon;
vMailItem := Outlook.CreateItem(olMailItem);
vMailItem.Recipients.Add('RECIPIENT EMAIL ADDRESS HERE');
vMailItem.Subject := 'What a wonderful test email';
vMailItem.HTMLBody := sList.text; // 'This is a test --> how amazing';
//vMailItem.Send;
vMailItem.Display;
Outlook.free;
16 2022-12-01 09:58:53
Re: send mail (8 replies, posted in General)
Hi
The email test.zip file does not contain any code!
I'm not sure what you mean that no code is in the zip file.
Below is code that works in Windows 10. I developed it on a Windows 10 PC. Note Outlook can be temperamental when using HTML, it may not always display correctly.
This takes information from a tablegrid and attempts to format it as a grid in an Outlook email. The text in red is all that is needed to actually use Outlook. The MAILTO line will work in any modern email client
procedure frmEmail_btnSendEmail_OnClick (Sender: TObject; var Cancel: boolean);
const
olMAILITEM = 0;
var
Outlook: Variant;
vMailItem: variant;
indx : integer;
txt, propName: String;
sList:TstringList;
begin
sList:=TStringList.Create;
sList.Add('<html>');
sList.Add('<head>');
sList.add('<style>');
sList.Add('table, th, td {');
sList.Add(' border: 1px solid #dddddd; text-align: left; padding: 8px');
sList.Add('}');
sList.Add('</style>');
sList.add('</head>');
sList.Add('<body>');
sList.Add('<table>');
sList.Add('<tr><th>Part Number</th>'+ '<th>BSuite#</th>' + '<th>Description'+ '</th>'+'<th>Qty'+'</th>'+'<th>For'+'</th>'+'</tr>');
for indx := 0 to frmEmail.tgEmailList.RowCount-1 do
begin
sList.Add('<tr><td>'+frmEmail.tgEmailList.Cells[0,indx] + '</td>' + '<td>' +frmEmail.tgEmailList.Cells[1,indx] +'</td>'+'<td>'+frmEmail.tgEmailList.Cells[2,indx]+'</td>'+'<td> x '+frmEmail.tgEmailList.Cells[3,indx]+'</td>'+'<td>'+frmEmail.tgEmailList.Cells[4,indx]+'</td></tr>');
end;
sList.Add('</table>');
sList.Add('</body>');
sList.Add('</html>');
if frmEmail.cmbSupplierList.ItemIndex = -1 then
messagebox('You have not selected an order to email. Please select a supplier', 'EMAILING ERROR',0)
else
begin
frmEmail.tgEmailList.dbPopUPMenu.Items.Find('Copy All').click;
txt := ClipboardGet;
try
[color=red] [b]propName := 'https://schemas.microsoft.com/mapi/proptag/0x59020003';
Outlook := CreateOleObject('Outlook.Application');
vMailItem := Outlook.GetNamespace('MAPI');
vMailItem.Logon(null,null,true,null);
vMailItem := Outlook.CreateItem(olMailItem);
vMailItem.Recipients.Add(frmEmail.cmbEmailAddress.Text);
vMailItem.Subject := frmEmail.cmbSupplierList.Text;
vMailItem.HTMLBody := sList.text;
OutLook.SetProperty(propName, EncodingFlag);
vMailItem.Send;
Outlook.free;[/b][/color]
except
openURL('mailto:'+frmEmail.cmbEmailAddress.Text+'?Subject='+frmEmail.cmbSupplierList.Text+' Order'+'&Body='+sList.text);
end;
end;
end;
17 2022-11-16 09:47:31
Re: error message: database is locked (2 replies, posted in Script)
Hi eserjbrujo,
Is your database installed on a mapped network drive, or your PC has gone to sleep and you've woken the PC up, and tried to access the database almost immediately?
I'm assuming you are using SQLite as the database.
I have had similar error messages when the database is installed on a mapped drive on a network and a cache scraper program is running in the background. The other PCs only have to have a momentary disconnection from the mapped drive and the DB reports itself as locked.
18 2022-11-12 03:05:45
Re: Training courses for developers. Articles about application developmen (93 replies, posted in General)
I have posted this in the Russian section as well.
Konstantin - I've translated your 'Clear App' project into English if you are interested.
I haven't translated or updated the 'help' file though.
I should say, if anyone wants the translated version, they'll need to go through K245 to get it.
Константин - Я перевел ваш проект Clear App на английский язык, если вам интересно.
Я не переводил и не обновлял файл справки.
Я должен сказать, что если кому-то нужна переведенная версия, им нужно пройти через K245, чтобы получить ее.
19 2022-11-11 12:36:32
Re: Курсы обучения и статьи о разработке приложений (239 replies, posted in Russian)
Константин - Я перевел ваш проект Clear App на английский язык, если вам интересно.
Я не переводил и не обновлял файл справки.
Konstantin - I've translated your 'Clear App' project into English if you are interested.
I haven't translated or updated the 'help' file though..
20 2022-11-03 10:37:44
Re: Курсы обучения и статьи о разработке приложений (239 replies, posted in Russian)
I read your article on Multibase idea.
You could make it multibase and objective database by possibly using either BOLD For Delphi (now open source and being very slowly updated, does work with Firedac) or Mormot which interfaces to most databases but internally uses Sqlite. Mormot probably does more than is ever needed,and has a steep learning curve if you need to get into server based databases REST etc.
If possible the DB adapter and basic object DB files could be compiled into a DLL file one for each of the supported databases, then the developer of myvisual multibase project could at DB table design time, select from a list of supported databases and the correct DLL is then referenced 'behind-the-scenes', the developer continues to design their database as with the current MVD.
I would suggest using a more recent version of a Pascal Script utility if keeping that idea in a revamped program.
Я прочитал вашу статью об идее Multibase.
Вы можете сделать его многобазовой и объективной базой данных, возможно, используя либо BOLD For Delphi (теперь с открытым исходным кодом и очень медленно обновляется, работает с Firedac), либо Mormot, который взаимодействует с большинством баз данных, но внутри использует Sqlite. Mormot, вероятно, делает больше, чем когда-либо необходимо, и у него крутая кривая обучения, если вам нужно попасть в серверные базы данных REST и т. Д.
Если возможно, файлы адаптера БД и базовые объектные файлы БД можно было бы скомпилировать в файл DLL, по одному для каждой из поддерживаемых баз данных, тогда разработчик проекта myvisual multibase мог бы во время проектирования таблицы БД выбрать из списка поддерживаемых баз данных и правильную DLL. затем упоминается «за кулисами», разработчик продолжает проектировать свою базу данных, как и в текущем MVD.
Я бы предложил использовать более новую версию утилиты Pascal Script, если сохраните эту идею в обновленной программе.
21 2022-11-03 10:21:59
Re: Защита базы данных (5 replies, posted in Russian)
SergeiE wrote:Добрый день!
Есть ли способы защитить или зашифровать базу (sqlite.db файл), что бы нельзя было прочитать в какой ни будь программе типа SQLiteStudio и подобных?
Вы можете использовать EncryptRC5(,) и DecryptRC5(,) , перед записью и чением данных
I tried that in a project a few years ago. I hit a problem - encrypt worked fine, but decrypt didn't work and just locked the SqLite database. For a reason I never got to the bottom of, the decrypt key applied provided a different result to the same key used for encryption.
Your value might vary.
22 2022-10-17 09:39:50
Re: How to get calculated fields in queries? (4 replies, posted in SQL queries)
In b.is_active, what is b?
b is an alias for the 'bookings' table.
The idea is, you don't have to keep writing the full name of a table (especially if it is a long name), it can be referred to either by a single letter or a shorter name.
It is declared in the line bookings AS b.
23 2022-10-07 09:28:56
Re: First lesson from the book, .exe file not opening up (8 replies, posted in Reports)
Attaching the file will be helpful as mentioned by Derek, but in the meantime, it might be worth checking your antivirus or firewall is not preventing the program from opening correctly.
24 2022-10-06 08:16:29
Re: please help, Can the project be connect with Microsoft sql server? (9 replies, posted in General)
Thinking about how to make the connection secure, by which I take you mean the connection string is obfuscated in some way, I came up with the following idea. Not tested, so have no idea if it would work, and is probably more complicated than needs be!
1. Create a SQLite database that has just one table and for security about 5 fields.
..... Field 1 contains an encrypted form of the connection path details.
..... Field 2 ........ contains the encryption key spread across one or more fields, the other fields contain dummy information and or the password
.
2. Before opening the SQL Server connection as demonstrated above, read in the SQLite database contents and perform the deincryption.
3. Parse the results into the actual db_settings:='Provider=SQLOLEDB;Server=localhost;database=DatabaseName;UID=UserName;PWD=password';
To make it more secure, a function could be written that actually changes the encryption key (some sort of randomise function) each time the program is run, This could be placed on the MainForms OnClose event where the new encrypted path and key can be written back to the database. I assume the SQL Server DB would be disconnected at this point as well.
I've probably over thought this far more than is necessary, but if it worked, this idea could also be used for other settings in the ini file such as column widths in tablegrids etc.
The other option would be to have the encryption or password key in plain sight, but looking like an encrypted string.
25 2022-07-31 01:12:22
Re: Create logout button (7 replies, posted in Script)
I have an auto/manual log out function which I've attached below. I came up with this because the SQLite DB is on a mapped drive and the IT department have a periodic cache scraper programme running. This plays havoc with SQLite cuasing users to either be logged out or never logged out even after they have closed the program. Obviously SQLite is not designed to run on mapped/shared drives.
I have an extra table called user_log which contains logging on time and last logged in time.
//Forced logout by user.
procedure frmMain_btnLogOut_OnClick (Sender: TObject; var Cancel: boolean);
begin
ClearLogs;
MessageDlgTimeOut('You have logged out'+#13#13+' Program will CLOSE in 4 seconds','LOG OUT INFORMATION',0,4000);
frmMain.Close;
end;
//Clear Logs
//user_log
var
logged_in : boolean = False;
procedure ClearLogs;
begin
SqlExecute('DELETE FROM user_log WHERE username = "' + Application.User.Username + '"');
end;
Combined with this I also have an auto program close for each user (they can set their own time span), as people were going home and not closing the program down causing major database corruption.