Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR8 Logon - please help!

Status
Not open for further replies.
Sep 13, 2001
11
US
I am trying to upgrade my ASP to CR8 from 7 but my logon code does not appear to work (see below) -
I have checked the samples and Seagate knowledgebase but no solution helped - what am I doing wrong?

'--> CREATE THE APPLICATION OBJECT
Set oApp = Server.CreateObject("CrystalRuntime.Application")
Set oRpt = oApp.OpenReport(Path & reportname, 1)

oRpt.MorePrintEngineErrorMessages = False
oRpt.EnableParameterPrompting = False

'--> SET THE LOCATION
oApp.LogonServer "p2sodbc.dll", CStr(DSN2), CStr(DatabaseNam), Cstr(uid), Cstr(pword)

set crtable = oRpt.Database.Tables(1)
crtable.SetLogonInfo CStr(DSN2), CStr(DatabaseNam), Cstr(uid), Cstr(pword)
 
Hi heres my code i use
<%@ Language=VBScript %>

<% Response.Buffer=True %>

<%

reportname= &quot;Your report name.rpt&quot;





if Not IsObject (session(&quot;oApp&quot;)) then

Set session(&quot;oApp&quot;)= Server.CreateObject(&quot;CrystalRuntime.Application&quot;)

End If

Path = Request.ServerVariables(&quot;PATH_TRANSLATED&quot;)

While (Right(Path, 1) <> &quot;\&quot; And Len(Path) <> 0)

iLen = Len(Path) - 1

Path = Left(Path, iLen)

Wend

If IsObject(session(&quot;oRpt&quot;)) Then

set session(&quot;oRpt&quot;) = nothing

End If



Set session(&quot;oRpt&quot;) = session(&quot;oApp&quot;).OpenReport(path & reportname, 1)

'session(&quot;oRpt&quot;).DiscardSavedData



session(&quot;oRpt&quot;).MorePrintEngineErrorMessages = False

session(&quot;oRpt&quot;).EnableParameterPrompting = False



userid= &quot;your id&quot;
password= &quot;your password&quot;
dsn=&quot;your dns&quot;
db=&quot;your database&quot;
'(if you have more than one table you have to cut and paste the line below and change item() to 2 and more if you have
more changr to 3 )
set crtable = session(&quot;oRpt&quot;).Database.Tables.Item(1)

crtable.SetLogonInfo cstr(dsn), cstr(db), cstr(userid), cstr(password)

if not crtable.TestConnectivity then

response.write &quot;ReCrystallize Warning: Unable to connect to data source using the following information.<BR><BR>&quot;

response.write &quot;Server / ODBC data source: &quot;& dsn&&quot;<BR>&quot;

response.write &quot;Database / Table:&quot;& db &&quot; <BR>&quot;

response.write &quot;User Name: &quot; & userid & &quot;<BR>&quot;

response.write &quot;Password: &quot; & password & &quot;<BR><BR><BR>&quot;

end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top