Solved

VB 6 with Crystal Report 7

Posted on 2000-04-17
7
222 Views
Last Modified: 2010-05-02
I am using Crystal Report 7 for VB 6.  I have report file Category.rpt to get a report for SQL Server for the following

Server Name : KUMAR
User ID     : kumar
Password    : 123
Database    : Inventory

What is the code we have to write during Runtime in the VB ?.
It means


With CateRpt
  ??????????
  .PrintReport
End with

Thanks
0
Comment
Question by:thangaraj
  • 4
  • 2
7 Comments
 

Expert Comment

by:gafftech
ID: 2726524
Are you using the .ocx control?

if so

with CateRpt
..filename = "c\category.rpt"
..Preview
end with

0
 
LVL 2

Expert Comment

by:brice123
ID: 2726570
   With CateRpt
      ' Maximize the report viewer
      .WindowState = crptMaximized
   
      ' Select destination to screen
      .Destination = crptToWindow
     
      ' Set the window title
      .WindowTitle = "Preview"
   
    ' Set the report file name
      .ReportFileName = "reportname.rpt"
   
      ' Discard saved data
      .DiscardSavedData = True
   
      ' Connect to database (using ODBC)
      .Connect="DSN=KUMAR;UID=KUMAR;PWD=123"
   
      ' Print the report
      .Action = 1
    End With


Drop me a line if you need further explanations
0
 

Author Comment

by:thangaraj
ID: 2733462
I don't have DSN. Because I am using SQL Server 7. What is the Code ?
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:thangaraj
ID: 2733467
Yes, I am using .ocx
0
 

Author Comment

by:thangaraj
ID: 2733476
Any Solution
0
 

Accepted Solution

by:
gafftech earned 50 total points
ID: 2734236
If you look in Help it is under DSN-Less connections.  I can't remember the sytax i think it is
Try this using a normal connectino string

..Connect="pwd=Test;uid=test1;provider=SQLOLEDB;database=test"

Don't forget you need to be using the pdssql.dll in your report.  If you aren't within crystal go to Database change driver and select that .dll

0
 

Author Comment

by:thangaraj
ID: 2734453
Yes, It works fine. Can i get ur email ID. I will mail U, if any doubt

Thanks  a  lot
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question