Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB 6 with Crystal Report 7

Posted on 2000-04-17
7
Medium Priority
?
227 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

916 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