views:

289

answers:

2

I use DBGrid to display Hyperlink type field from Microsoft Access database (MDB). Normally dbgrid displays hyperlink values like "(MEMO)", without editing capablity. Is there a way to solve this?

+2  A: 

check this article: http://delphi.about.com/library/weekly/aa030105a.htm I hope it will help you

Issam Ali
Using this I can display the content of the field, but it doesn't behave as a hyperlink, and shows as a simple text. Is there a way to fix it?
Tofig Hasanov
you may use cellclick event, and call ShellExcecute function:ShellExecute(0, 'open', pchar([fieldname].AsString), nil,nil, SW_Normal);
Issam Ali
Used this, and it worked, although I had to format cell content. Due to some reason hyperlink was not stored as a normal text, but rather something like "www.google.com #www.google.com#". Still now it works, thanks
Tofig Hasanov
"www.google.com #www.google.com#" is how hyperlinks are stored in an Access hyperlink field, which is just a memo field with a flag somewhere that tells Access to display it as a hyperlink. Most Access developers I know avoid use of them. If you can change the Jet database, I'd recommend dumping the hyperlink field in favor of a Text 255 field or a normal memo field.
David-W-Fenton
A: 

DBGrid displays values based on field type. If it shows (MEMO) then you probably declared your field in your database as TEXT or something equivalent. Can't remember Access, but in MS-SQL Server you can change field type to varchar and DBGrid will display values as editable text.

Linas