Hi,
The project I am working on uses ODBC sources from our "test" and "production" SQL Server 7 servers. I have added a parameter to the exe file that if you add "TEST" it will pull from the test system using SQL commands hard coded in VB6. I need to know how in VB6 (SP4) and/or CR v8.0441 code how to do this "on the fly." I have tried the LogOnServer command with no success. I don't understand the "SetLogOnInfo" command at all. I have stored procedures and data on the different servers I need to point to. I use about 20 rpt files thru 1 CR viewer form and that is my biggest problem with using the examples that I have found on this forum and in Crystal Decisions website/knowledge base.
I am using this code:
Dim crxapp As New CRAXDRT.Application
Dim crxrpt As New CRAXDRT.Report
Dim frmViewerForm As frmRPT2Viewer
Set frmViewerForm = New FrmRPT2Viewer
if WhichSystem = "TEST" then
crxapp.LogOnServer "p2sodbc.dll", "testdb", "Collections", "userid", "password"
else
crxapp.LogOnServer "p2sodbc.dll", "proddb", "Collections", "userid", "password"
endif
Set crxrpt = crxApp.OpenReport("C:\Report09"
frmViewerForm.CRViewer1.ReportSource = crxrpt
frmViewerForm.CRViewer1.ViewReport
frmViewerForm.Show
Here is the EXACT error I get now and the fix(?) Which "solution" do I use in my case?
Here is what I'm using:
crxApp.LogOnServer "p2sodbc.dll", systemname, "Collections", "", ""
- systemname is a variable set based on parameter passed ("S6" for test) ("DELL6300" for prod)
- "Collections" is the table name of the SQL Server (according to M$ Intellisense)
- I want the userid and password of Win NT login passed.
Any ideas on this one?
Thanks,
Brett Please visit my websites!
The project I am working on uses ODBC sources from our "test" and "production" SQL Server 7 servers. I have added a parameter to the exe file that if you add "TEST" it will pull from the test system using SQL commands hard coded in VB6. I need to know how in VB6 (SP4) and/or CR v8.0441 code how to do this "on the fly." I have tried the LogOnServer command with no success. I don't understand the "SetLogOnInfo" command at all. I have stored procedures and data on the different servers I need to point to. I use about 20 rpt files thru 1 CR viewer form and that is my biggest problem with using the examples that I have found on this forum and in Crystal Decisions website/knowledge base.
I am using this code:
Dim crxapp As New CRAXDRT.Application
Dim crxrpt As New CRAXDRT.Report
Dim frmViewerForm As frmRPT2Viewer
Set frmViewerForm = New FrmRPT2Viewer
if WhichSystem = "TEST" then
crxapp.LogOnServer "p2sodbc.dll", "testdb", "Collections", "userid", "password"
else
crxapp.LogOnServer "p2sodbc.dll", "proddb", "Collections", "userid", "password"
endif
Set crxrpt = crxApp.OpenReport("C:\Report09"
frmViewerForm.CRViewer1.ReportSource = crxrpt
frmViewerForm.CRViewer1.ViewReport
frmViewerForm.Show
Here is the EXACT error I get now and the fix(?) Which "solution" do I use in my case?
Here is what I'm using:
crxApp.LogOnServer "p2sodbc.dll", systemname, "Collections", "", ""
- systemname is a variable set based on parameter passed ("S6" for test) ("DELL6300" for prod)
- "Collections" is the table name of the SQL Server (according to M$ Intellisense)
- I want the userid and password of Win NT login passed.
Any ideas on this one?
Thanks,
Brett Please visit my websites!