scott said:
Anyone have a link to syntax that could create an outlook vcard file
format? all examples i find are for doing it inside outlook with .net.
i'm just looking for an ASP solution.
This SQL statement will construct a vcard from a table of contacts.
(Assumes SQL Server is the db engine. You'll need to adjust field names to
match your schema, needless to say.)
---------------------------------------------
DECLARE @crlf char(2)
SET @crlf = CHAR(13) + CHAR(10)
SELECT 'BEGIN:VCARD' + @crlf
+ COALESCE ('N:' + COALESCE (Last, '') + ';'
+ COALESCE (First, '') + ';'
+ COALESCE (Mi, '') + @crlf, '')
+ COALESCE ('FN:' + FullName + @crlf, '')
+ COALESCE ('TITLE:' + Title + @crlf, '')
+ COALESCE ('ORG:' + Company + @crlf, '')
+ COALESCE ('TEL;WORK;VOICE:' + PhoneWork + @crlf, '')
+ COALESCE ('TEL;WORK;FAX:' + FaxWork + @crlf, '')
+ COALESCE ('TEL;HOME;VOICE:' + [PhoneHome] + @crlf, '')
+ COALESCE ('TEL;HOME;FAX:' + [FaxHome] + @crlf, '')
+ COALESCE ('TEL;CELL;VOICE:' + [PhoneMobile] + @crlf, '')
+ COALESCE ('TEL;PAGER;VOICE:' + [Pager] + @crlf, '')
+ 'ADR;WORK:;;' + COALESCE ([Address], '') + ';'
+ COALESCE ([City], '') + ';' + COALESCE ([State], '') + ';'
+ COALESCE ([Zip], '') + @crlf
+ COALESCE ('EMAIL;PREF;INTERNET:' + (e-mail address removed)