Borland Database Engine (BDE) Config Disappears

Being a programmer for so many years, i have been accustomed to a adapt to different circumstances and scenarios. Here are my top reasons why Borland Database Engine (BDE) profiles seem to dissapear.

* Windows User Account Control Settings
Now this one is the first one on the list. When you modify the security level from medium to low, this is the first one in my list.

* Deepfreeze Software or Any Software that Restores Back Windows
This one is quite obvious. deepfreeze is a software that when you restart your pc, it reverts back to the way it was. Yeah, who knows, you might be a victim of one.

* Windows 10 Update
Now this one beats the cake. So far, when Windows downloads an update to yur pc, be sure that he meddled with the settings. Well, it’s a bit off topic but my system date and time, Windows keep setting it to automatically update. This feature i usually turn off because i set the time minutes advance.

I created a youtube video to show some pictures of what i mean

Enjoy

Coffee Cup

https://youtu.be/sAamLzyf_yk

Windows 10, 8, 7 : alt+printscreen does not work. Solved

after i experienced this, windows 10 just updated again (after I disabled it) i had doubts if windows managed to disable this one. i tried to look at a lot of blogs and forums but so far, a lot of them suggested changing the keyboard. funny for me, i am using a laptop.

then it just hit me. i just downloaded software for screen capture and it downed on me that the software might be catching the keystrokes such as the alt+printscreen. when i closed the app, the alt+printscreen now works.

i just solved my own dilemma. hope somebody learns from this.

enjoy

coffee cup

Interbase : How to get the weekday , month, year and day from timestamp

its amazing that a lot of the functions needed in our daily lives get embedded to a lot of software’s out there.

This is a case that i needed to generate employees who went in on Monday. I was able to dig out these great finds.

Enjoy

Coffee Cup

 

The data type of EXTRACT() expressions depends on the specific part being extracted:

Extract Resulting
data type
Representing
YEAR SMALLINT Year, range 0-5400
MONTH SMALLINT Month, range 1-12
DAY SMALLINT Day, range 1-31
HOUR SMALLINT Hour, range 1-23
MINUTE SMALLINT Minute, range 1-59
SECOND DECIMAL(6,4) Second, range 0-59.9999
WEEKDAY SMALLINT Day of the week, range 0-6
(0 = Sunday, 1 = Monday, and so on)
YEARDAY SMALLINT Day of the year, range 1-366
SELECT EXTRACT (YEAR FROM timestamp_fld) FROM table_name;
=======
1999
SELECT EXTRACT (YEAR FROM timestamp_fld) FROM table_name;
=======
1999
SELECT EXTRACT (MONTH FROM timestamp_fld) FROM table_name;
=======
6
SELECT EXTRACT (DAY FROM timestamp_fld) FROM table_name;
=======
25
SELECT EXTRACT (MINUTE FROM timestamp_fld) FROM table_name;
=======
24
SELECT EXTRACT (SECOND FROM timestamp_fld) FROM table_name;
============
35.0000
SELECT EXTRACT (WEEKDAY FROM timestamp_fld) FROM table_name;
=======
5
SELECT EXTRACT (YEARDAY FROM timestamp_fld) FROM table_name;
=======
175
SELECT EXTRACT (MONTH FROM timestamp_fld) ||
'-' || EXTRACT (DAY FROM timestamp_fld) ||
'-' || EXTRACT (YEAR FROM timestamp_fld) FROM table_name;
====================
6-25-1999

Source : http://docwiki.embarcadero.com/InterBase/XE7/en/Extracting_Date_and_Time_Information

 

 

Windows 7 : How to access the advanced boot options on your laptop

If you are a windows pc user for quite some time, accessing the Windows 7 to see the Advanced Boot Options can be a challenge if you are using different laptop brands. Here are the list of shortcut key combinations

Enjoy

Coffee Cup

 

Acer – Alt + F10

Asus – F9

Dell/Alienware – F8

HP – F11

Lenovo – F11

MSI – F3

Samsung – F4

Sony – F10

Toshiba – 0 (not numpad) while turning on, release key when Toshiba logo appears

 

Delphi : How to change the date format on both inside the app and globally

I have encountered an issue the other week of a friend that want the default date be changed to another format inside the app. After digging a few days later i came out with a complete list of local settings you can change while inside the delphi environment. Will be posting the codes here for anyone who has encountered the same issues as i have. Hope this helps somebody out there.

Enjoy

Coffee Cup

CurrencyString, CurrencyFormat, NegCurrFormat, ThousandSeparator,
DecimalSeparator, CurrencyDecimals, DateSeparator, ShortDateFormat,
LongDateFormat, TimeSeparator, TimeAMString, TimePMString,
ShortTimeFormat, LongTimeFormat

//Change COMPUTER date and time
SetLocaleInfo(GetThreadLocale, LOCALE_SSHORTDATE, ‘MM/dd/yyyy’);
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0,
SMTO_ABORTIFHUNG, 1000, PDWord(Nil)^);

//Change formatting from within the APPLICATION
DateSeparator := ‘/’;
ShortDateFormat := ‘MM/dd/yyyy’;

Delphi : Retrieving various locale information

I got this info from a website that showcases all of the identifiers for each pc. Thought of posting it here also in my blog for future references

Question: How can I determine various locale information using delphi?

Answer:
Delphi has a function called GetLocaleInfo which you can use to retrieve information such as the system language, currency symbol, number of decimal digits and so forth.

Here is a function that will return locale information based on the parameter “flag” :

……..
function TForm1.GetLocaleInformation(Flag: Integer): String;
var
pcLCA: Array[0..20] of Char;
begin
if( GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,Flag,pcLCA,19) pcLCA[0] := #0;
end;
Result := pcLCA;
end;
……..

Example of using the function:

……..
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(GetLocaleInformation(LOCALE_SENGLANGUAGE));
end;
……..

“Flag” can take the following values (as seen in Windows.pas):

LOCALE_NOUSEROVERRIDE { do not use user overrides }
LOCALE_USE_CP_ACP { use the system ACP }
LOCALE_ILANGUAGE { language id }
LOCALE_SLANGUAGE { localized name of language }
LOCALE_SENGLANGUAGE { English name of language
LOCALE_SABBREVLANGNAME { abbreviated language name }
LOCALE_SNATIVELANGNAME { native name of language }
LOCALE_ICOUNTRY { country code }
LOCALE_SCOUNTRY { localized name of country }
LOCALE_SENGCOUNTRY { English name of country }
LOCALE_SABBREVCTRYNAME { abbreviated country name }
LOCALE_SNATIVECTRYNAME { native name of country }
LOCALE_IDEFAULTLANGUAGE { default language id }
LOCALE_IDEFAULTCOUNTRY { default country code }
LOCALE_IDEFAULTCODEPAGE { default oem code page }
LOCALE_IDEFAULTANSICODEPAGE { default ansi code page }
LOCALE_IDEFAULTMACCODEPAGE { default mac code page }
LOCALE_SLIST { list item separator }
LOCALE_IMEASURE { 0 = metric, 1 = US }
LOCALE_SDECIMAL { decimal separator }
LOCALE_STHOUSAND { thousand separator }
LOCALE_SGROUPING { digit grouping }
LOCALE_IDIGITS { number of fractional digits }
LOCALE_ILZERO { leading zeros for decimal }
LOCALE_INEGNUMBER { negative number mode }
LOCALE_SNATIVEDIGITS { native ascii 0-9 }
LOCALE_SCURRENCY { local monetary symbol }
LOCALE_SINTLSYMBOL { intl monetary symbol }
LOCALE_SMONDECIMALSEP { monetary decimal separator }
LOCALE_SMONTHOUSANDSEP { monetary thousand separator }
LOCALE_SMONGROUPING { monetary grouping }
LOCALE_ICURRDIGITS { # local monetary digits }
LOCALE_IINTLCURRDIGITS { # intl monetary digits }
LOCALE_ICURRENCY { positive currency mode }
LOCALE_INEGCURR { negative currency mode }
LOCALE_SDATE { date separator }
LOCALE_STIME { time separator }
LOCALE_SSHORTDATE { short date format string }
LOCALE_SLONGDATE { long date format string }
LOCALE_STIMEFORMAT { time format string }
LOCALE_IDATE { short date format ordering }
LOCALE_ILDATE { long date format ordering }
LOCALE_ITIME { time format specifier }
LOCALE_ITIMEMARKPOSN { time marker position }
LOCALE_ICENTURY { century format specifier (short date) }
LOCALE_ITLZERO { leading zeros in time field }
LOCALE_IDAYLZERO { leading zeros in day field (short date) }
LOCALE_IMONLZERO { leading zeros in month field (short date) }
LOCALE_S1159 { AM designator }
LOCALE_S2359 { PM designator }
LOCALE_ICALENDARTYPE { type of calendar specifier }
LOCALE_IOPTIONALCALENDAR { additional calendar types specifier }
LOCALE_IFIRSTDAYOFWEEK { first day of week specifier }
LOCALE_IFIRSTWEEKOFYEAR { first week of year specifier }
LOCALE_SDAYNAME1 { long name for Monday }
LOCALE_SDAYNAME2 { long name for Tuesday }
LOCALE_SDAYNAME3 { long name for Wednesday }
LOCALE_SDAYNAME4 { long name for Thursday }
LOCALE_SDAYNAME5 { long name for Friday }
LOCALE_SDAYNAME6 { long name for Saturday }
LOCALE_SDAYNAME7 { long name for Sunday }
LOCALE_SABBREVDAYNAME1 { abbreviated name for Monday }
LOCALE_SABBREVDAYNAME2 { abbreviated name for Tuesday }
LOCALE_SABBREVDAYNAME3 { abbreviated name for Wednesday }
LOCALE_SABBREVDAYNAME4 { abbreviated name for Thursday }
LOCALE_SABBREVDAYNAME5 { abbreviated name for Friday }
LOCALE_SABBREVDAYNAME6 { abbreviated name for Saturday }
LOCALE_SABBREVDAYNAME7 { abbreviated name for Sunday }
LOCALE_SMONTHNAME1 { long name for January }
LOCALE_SMONTHNAME2 { long name for February }
LOCALE_SMONTHNAME3 { long name for March }
LOCALE_SMONTHNAME4 { long name for April }
LOCALE_SMONTHNAME5 { long name for May }
LOCALE_SMONTHNAME6 { long name for June }
LOCALE_SMONTHNAME7 { long name for July }
LOCALE_SMONTHNAME8 { long name for August }
LOCALE_SMONTHNAME9 { long name for September }
LOCALE_SMONTHNAME10 { long name for October }
LOCALE_SMONTHNAME11 { long name for November }
LOCALE_SMONTHNAME12 { long name for December }
LOCALE_SMONTHNAME13 { long name for 13th month (if exists) }
LOCALE_SABBREVMONTHNAME1 { abbreviated name for January }
LOCALE_SABBREVMONTHNAME2 { abbreviated name for February }
LOCALE_SABBREVMONTHNAME3 { abbreviated name for March }
LOCALE_SABBREVMONTHNAME4 { abbreviated name for April }
LOCALE_SABBREVMONTHNAME5 { abbreviated name for May }
LOCALE_SABBREVMONTHNAME6 { abbreviated name for June }
LOCALE_SABBREVMONTHNAME7 { abbreviated name for July }
LOCALE_SABBREVMONTHNAME8 { abbreviated name for August }
LOCALE_SABBREVMONTHNAME9 { abbreviated name for September }
LOCALE_SABBREVMONTHNAME10 { abbreviated name for October }
LOCALE_SABBREVMONTHNAME11 { abbreviated name for November }
LOCALE_SABBREVMONTHNAME12 { abbreviated name for December }
LOCALE_SABBREVMONTHNAME13 { abbreviated name for 13th month (if exists) }
LOCALE_SPOSITIVESIGN { positive sign }
LOCALE_SNEGATIVESIGN { negative sign }
LOCALE_IPOSSIGNPOSN { positive sign position }
LOCALE_INEGSIGNPOSN { negative sign position }
LOCALE_IPOSSYMPRECEDES { mon sym precedes pos amt }
LOCALE_IPOSSEPBYSPACE { mon sym sep by space from pos amt }
LOCALE_INEGSYMPRECEDES { mon sym precedes neg amt }
LOCALE_INEGSEPBYSPACE { mon sym sep by space from neg amt }
LOCALE_FONTSIGNATURE { font signature }
LOCALE_SISO639LANGNAME { ISO abbreviated language name }
LOCALE_SISO3166CTRYNAME { ISO abbreviated country name }

URL:
http://delphi.cjcsoft.net//viewthread.php?tid=45725

Delphi : Set system locale information

So far this is what i had dig up on the topic. It made sense to post this one here since i am pretty sure somebody’s also looking for this info. Hehehe

Enjoy

Coffee Cup

procedure SetLocaleInfoSample;
var number, ds, lz;
begin
number := 0.7;

// Remember default number settings
ds := GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL);
lz := GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILZERO);

// Log a number using default settings
Log.Message( FloatToStr(number) );

// Log a number using a different decimal separator
SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, ‘,’);
Log.Message( FloatToStr(number) );

// Log a number without the leading zero
SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILZERO, ‘0’);
Log.Message( FloatToStr(number) );

// Restore original settings
SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, ds);
SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILZERO, lz);
end;

{
The function produces the following output for US English locale:

0.7
0,7
,7
}

procedure ChangeShortDate;
var strOldShortDate;
begin
// Get current short date format
strOldShortDate := GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE);

if not SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE, ‘yyyy/MM/dd’) then
Log.Error(‘Could not change short date format.’);

// Restore original short date format
if not SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE, strOldShortDate) then
Log.Error(‘Could not restore original short date format.’);
end;

How to add or remove password in MS Excel 2007

Had to chance up on encountering this problem again. Fortunately, you need to follow these steps in order to add or remove passwords in MS Excel 2007.

I have made a youtube video to show both the short version and the long version on how to achieve this.

For the short version here are the steps

Open Microsoft Excel 2017 workbook
Open the file to add or remove the password
Click the ORB logo on the top left
Click the ‘Save As’ button
Click the ‘Tools’ button and then click ‘General Options‘ tab
In the ‘Password to open’ box, add or delete the existing password then click ‘OK’.
Click the ‘Save’ button. If prompted, click ‘Yes’ to replace the existing workbook

Enjoy

Coffee Cup

Windows Server 2012 R2 Socket Network Error

Today is a new day. Mark and I installed a new windows server 2012 r2 and have also installed the drivers and software. We started using the Server Guide downloaded from the Lenovo Website and then the Operating System.

After installing, i loaded my app and hoped that it would run smoothly as always. But no, it did not push through as expected. I assigned the server with an ip address of #15. I use the DOS prompt ping and the ipaddress replied. I tried to look at the My Computer and typing the server name, and you can see the shared folders.

This is the whole message…
“EXCEPTION EBDE ENGINE ERROR IN MODULE XXX.EXE AT 00096F36. UNKNOWN DATABASE. UNABLE TO COMPLETE NETWORK REQUEST TO HOST ERVER_NAME? FAILED TO ESTABLISH A CONNECTION. A SOCKET OPERATION WAS ATTEMPTED TO A GENERAL SQL ERROR. UNREACHEABLE NETWORK ALIAS”

The error kept mentioning socket connection that was not successfuly. So what i did changed the ip address again. Lo and behold, i was able to run my app. Usually in normal windows pc the system should let you know if you have an ip address conflict. In this case, the server did not show that little dialog box.

It has been a very educational experience with conflicting ip address that in the windows server does not show you. Please note that the ip address belonged to a belkin device and not a PC or laptop. Maybe that could be the cause.

I tried to replicate the scenario in my Windows 7 pc and my pc reacted with a small message dialog of IP CONFLICT.

I have created a youtube video to show my adventure

Happy watching

Coffee Cup