Thursday, May 29, 2008

Unsolved problem: unidentified values in record causing duplicate view in dbgrid after post

Certain records, whether modified or created as new record in a same or different table with the same values causes duplicate or double records in dbgrid view. A refresh on the dataset removes the duplicate record. Also, I experienced the same problem on a mastersource with a float datatype masterfield opon post of a value with decimal. This causes certain anomalies or errors on program. Again, a refresh statement solves the problem.

But what causes this problem? I never encountered this simple stupidity on other databases except MSSQL.

Monday, May 26, 2008

Solved problem: delphi dbGrid won't/doesn't scroll record position - jologs!

This is the best solution of all. Others are either not functioning, have logical errors, or too complex. This is the most simple:
-----------------------------------------------

unit Unit1

interface

uses
DBGrids, Db, Controls, Windows, Messages,

type
NewControl = class(TControl);

...

private
procedure DBGridScroll(var Message: TMessage);
{ Private declarations }
public
{ Public declarations }

...

procedure TForm1.DBGridScroll(var Message: TMessage);
var
count : short;
begin
if (Message.Msg = WM_MOUSEWHEEL) then begin
count:=HIWORD(Message.WParam);
count:=count div 120;
DBGrid1.DataSource.DataSet.MoveBy(-count)
end else NewControl(DBGrid1).WndProc(Message);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
DBGrid1.WindowProc := DBGridScroll;
end;

Sunday, May 25, 2008

My new Sony NW-205F

Sony Walkman Series MP3 Player with Pedometer
Features: 2GB, 18 hrs batt life, digi-FM radio, water resistant, calorie counter, pedometer, stopwatch, presets, equalizer, normalizer, avls, power-saving, auto power-off, stylish design & lcd display, etc.


CNet Review
MP3NewsWire Review
Full spec

Thursday, May 15, 2008

Solved problem: date format variance in MSSQL

Here's another problem I encountered in Microsoft SQL.

Hence I work for an international organization, different countries use different date formats therefore my applications should be flexible to handle different date formats.

when I change my date format at MS Windows regional settings from MM/dd/yyyy to dd/MM/yyy, all applications with date formats following windows settings should all change, especially Microsoft products.

As I check, all dates in the database changed but unfortunately, query does not. Query to MSSQL still reverts and uses MM/dd/yyyy. That's why I had problems with my applications. Its the engine's fault! I solved the problem by converting the date I passed on a SQL statement to the date format that the query uses.

This is why I hate Microsoft. Unfortunately I'm bound to my org's standards.

Solved problem: MSSQL can't be accessed by another host

I had another problem with Microsoft SQL. ODBC on my MS Windows XP can be accessed thru localhost but not by another host. My database is hosted on a PC/Server and should be accessed by another host on a network/environment.

ODBC / DSN error message:
Connection failed:
SQLState: '01000'
SQL Server Error: 53
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()).
Connection failed:
SQLState: '08001'
SQL Server Error: 17
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

Duh?? What the?? I'm an expert but Microsoft sure knows how to make you dumb!
I already considered XP firewall settings, turned everything off.. I already have done almost all solutions found in the forums, including removing registry entries.

You know what fixed the prob? Simply add TCP port 445 on XP firewall advanced local area connection settings services. Port 445 is used by Windows for SMB over TCP.

Microsoft should consider commonly encountered problems and make easier solutions.

Compared to Interbase and MySQL, Microsoft SQL sucks! ....as always.