VB 6 with Crystal Report 7

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
End with

Who is Participating?
gafftechConnect With a Mentor Commented:
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


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

Are you using the .ocx control?

if so

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

   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)
      ' Print the report
      .Action = 1
    End With

Drop me a line if you need further explanations
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

thangarajAuthor Commented:
I don't have DSN. Because I am using SQL Server 7. What is the Code ?
thangarajAuthor Commented:
Yes, I am using .ocx
thangarajAuthor Commented:
Any Solution
thangarajAuthor Commented:
Yes, It works fine. Can i get ur email ID. I will mail U, if any doubt

Thanks  a  lot
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.