Hi here the code i use
<%@ Language=VBScript %>
<% Response.Buffer=True %>
<%
reportname= "Name of your report.rpt"
if Not IsObject (session("oApp"

) then
Set session("oApp"

= Server.CreateObject("CrystalRuntime.Application"
End If
Path = Request.ServerVariables("PATH_TRANSLATED"
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
If IsObject(session("oRpt"

) Then
set session("oRpt"

= nothing
End If
Set session("oRpt"

= session("oApp"

.OpenReport(path & reportname, 1)
'session("oRpt"

.DiscardSavedData
session("oRpt"

.MorePrintEngineErrorMessages = False
session("oRpt"

.EnableParameterPrompting = False
userid= "your id"
password= "your password"
dns="your DNS"
db="your database"
'set create table for as many table usein your report
'if you have 2 tables you have to cut and paste the
'and change the item() to 2 item(2)
set crtable = session("oRpt"

.Database.Tables.Item(1)
crtable.SetLogonInfo cstr(dns), cstr(db), cstr(userid), cstr(password)
if not crtable.TestConnectivity then
response.write "ReCrystallize Warning: Unable to connect to data source using the following information.<BR><BR>"
response.write "Server / ODBC data source: "& dns&"<BR>"
response.write "Database / Table:"& db &" <BR>"
response.write "User Name: " & userid & "<BR>"
response.write "Password: " & password & "<BR><BR><BR>"
end if