This is a forum where members new and old can come to ask questions and get info and opinions. It is not a place to advertise your business or have other forms of advertising, whether it be in your posts or signature.

All links in the forum will not be indexed by Search Engines and any unapproved forms of advertising or spam will be dealt with accordingly, deleted, and that member's account banned.

Forums

Overview » Adobe Creative Suite » Create a vCard from a db?
Reply

Create a vCard from a db?

Henrik Sandeberg
Freaking Member



Since: 27 Jun 2001
Posts: 82
Posted 20 Jul 2005 09:23:10

Hello,

I have a phonebook with names, numbers and emails, and so on, its in Access, I want to have a link like create_vcard.asp?id=20 or something like that, but how do i create the vcard script, anyone who has done this before?

Hello,

I have a phonebook with names, numbers and emails, and so on, its in Access, I want to have a link like create_vcard.asp?id=20 or something like that, but how do i create the vcard script, anyone who has done this before?
Henrik Sandeberg
Freaking Member



Since: 27 Jun 2001
Posts: 82
Replied 22 Jul 2005 09:49:38
So, after a while, i solved it, here is my solution, i have a db with surname, firstname and so on (access),

Any questions about it? I dont have the date of birth in the file.....

<pre id=code><font face=courier size=2 id=code>&lt;%@LANGUAGE="VBSCRIPT"%&gt;
&lt;!--#include file="Connections/Portal.asp" --&gt;
&lt;%
Dim Rstest__MMColParam
Rstest__MMColParam = "1"
If (Request.QueryString("user_id" &lt;&gt; "" Then
Rstest__MMColParam = Request.QueryString("user_id"
End If
%&gt;
&lt;%
Dim Rstest
Dim Rstest_numRows

Set Rstest = Server.CreateObject("ADODB.Recordset"
Rstest.ActiveConnection = MM_Portal_STRING
Rstest.Source = "SELECT * FROM list WHERE user_id = " + Replace(Rstest__MMColParam, "'", "''" + ""
Rstest.CursorType = 0
Rstest.CursorLocation = 2
Rstest.LockType = 1
Rstest.Open()

Rstest_numRows = 0
%&gt;
&lt;%
firstname = Rstest("firstname"
surname = Rstest("surname"
Address = Rstest("address"
Zip = Rstest("zip"
City = Rstest("city"
Country = Rstest("country"
Phone = Rstest("phone"
mobile = Rstest("mobile"
email = Rstest("email"
note = Rstest("note"
'dob = Rstest("dob"
sex = Rstest("sex"


response.AddHeader "content-disposition", "attachment; filename="& firstname &" "& surname &".vcf"

Response.write "BEGIN:VCARD"& vbcrlf
response.write "VERSION:2.1"& vbcrlf
Response.write "N:"& surname &";"& firstname & vbcrlf
response.write "FN:"& firstname &" "& surname & vbcrlf
response.write "NOTE:"& note & vbcrlf
response.write "TEL;HOME;VOICE:"& phone & vbcrlf
response.write "TEL;CELL;VOICE:"& mobile & vbcrlf
response.write "ADR;HOME:;;"& address &";"& city &";;"& zip &";"& country & vbcrlf
response.write "LABEL;HOME;ENCODING=QUOTED-PRINTABLE:"& address &"=0D=0A"& city & " "& zip &"=0D=0A"& Country & vbcrlf
response.write "X-WAB-GENDER:"
if sex = "male" then
response.write "2"& vbcrlf
else
response.write "1"& vbcrlf
end if
response.write "BDAY:"& year(date())& Right(0 & month(dob),2)&Right(0 & day(dob),2)& vbcrlf
response.write "EMAIL;PREF;INTERNET:"& email & vbcrlf
response.write "REV:"& year(date())& right(0& month(date()),2)& right(0& day(date()),2)&"T0"& right(0&second(now()),2)&right(0&minute(now()),2)&left(0&second(now()),1)&"Z"& vbcrlf
response.write "END:VCARD"
%&gt;
&lt;%
Rstest.Close()
Set Rstest = Nothing
%&gt; </font id=code></pre id=code>
Mark Neill
Member



Since: 26 Jul 2008
Posts: 1
Replied 26 Jul 2008 01:12:51
So how do I make the results invoke the outlook client to see the in contact?

Reply to this topic

Message
Reply
Follow us on Facebook Follow us on twitter Subscribe to the RSS feed
Activate your free membership today | Login | Currency