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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime file requirements

Status
Not open for further replies.

jonnodude

Programmer
Dec 7, 2001
2
0
0
US
Hello all,

I have integrated two RDC reports (both with sub-reports)
into a VB6 application. I am using the OLEDB Driver for SQL Server using SQL Server authentication as I am working on a windws 98 network. Both reports were built against the database they are currently being executed against, hoever I would like to set the logon ifo at run time

The code to set the parameters and logon info for the report looks like the following (gobjsession is just an object that holds connection parameters)

Dim objTimeSheetReport As New dsrTimeSheetReport 'main rpt
Dim objSubReport As CRAXDRT.Report

With gObjSession
objTimeSheetReport.ParameterFields(1).AddCurrentValue FromRosterDate
objTimeSheetReport.ParameterFields(2).AddCurrentValue ToRosterDate
For i = 1 To objTimeSheetReport.Database.Tables.Count
objTimeSheetReport.Database.Tables(i).SetLogOnInfo .Server, .Database, .UserID, .Password
objTimeSheetReport.Database.Tables(i).Location = gobjClientUtility.stripOwner(objTimeSheetReport.Database.Tables(i).Location)
Next

Set objSubReport = objTimeSheetReport.OpenSubreport("TimeSheet")
For i = 1 To objSubReport.Database.Tables.Count
objSubReport.Database.Tables(i).SetLogOnInfo .Server, .Database, .UserID, .Password
objSubReport.Database.Tables(i).Location = gobjClientUtility.stripOwner(objSubReport.Database.Tables(i).Location)
Next
End With


CRViewer.ReportSource = objTimeSheetReport
CRViewer.ViewReport


This code works perfectly in both in the IDE and as a compiled application on the machine where crystal reports is installed in its full version. The problem is that every machine I install the application on (built with the visual studio packager) I get the dreaded "not yet logged on server" message whenever a report is run. All destination machines are also running windows 98. and all have MDAC service pack 2.61


The VB6 deployment wizard packages the following DLLS by default:

P2smon.dll,$(WinSysPath)
PG32CONV.DLL,$(WinSysPath)
SSCSDK80.DLL,$(WinSysPath)
MFC42.DLL,$(WinSysPath)
MSVCRT.DLL,$(WinSysPath)
Crpaig80.dll,$(WinSysPath)
Implode.dll,$(WinSysPath)
craxddrt.dll,$(WinSysPath)
craxdrt.dll,$(WinSysPath)
crviewer.dll,$(WinSysPath)

What am I missing? If I can't get this thing to install I'm just going to install the whole Crystal reports on everones machine as my "free runtime license"

Appreciate any feedback
Cheers
Jonno
 
Alright I'll answer my own post.

The package and deployment wizard did not pick up p2soledb.dll or p2sodbc.dll which both belong in the system directory.

Everythings cool now. :)

J Shaw Consulting
info@jshawconsulting.com
 
I don't know if this will answer your question or help you, but in the past I've used an actual login.frm that captures the login information for each user in global variables that are declared in a file I created called global.bas module.
I then use these global variables as follows:

Public Sub AddDatabase()
'Variables used to setup the Database connection
Dim crDBTables As CRAXDRT.DatabaseTables
Dim sTableName As String
Dim iTableType As Integer
Dim sDLLName As String
Dim sServerName As String
Dim sDatabaseName As String
Dim sUserName As String
Dim sPassword As String

'Get the TABLES collection because it has the ADD() method needed to add a conection the report
Set crDBTables = crReport.Database.Tables

'Set the values for the connection variables

'The database Stored Procedures
sTableName = "STES_GetDailyFundDetails"

'The database table type. Set this to 2 for all stored procedures
iTableType = 2

'The database DLL name (Crystal Native MSSQL Driver)
sDLLName = "p2ssql.dll"

'The physical server name
sServerName = strServer

'The database name
sDatabaseName = strDatabase

'The user ID
sUserName = strUserName

'The password
sPassword = strPassword

'Use the .Add() method to add the Stored Procedure to the report.
'There are several optional arguments for the Add method. which
'arguments are passed will depend on the type of database, the type
'of the table and the type of connection.

crDBTables.Add sTableName, , , iTableType, sDLLName, sServerName, , sDatabaseName, sUserName, sPassword


End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top