Solved

saving Crystal Report ADO connection string or ODBC connection details with report

Posted on 2004-10-24
8,747 Views
Last Modified: 2012-08-13
Hi,
I have a Crystal Reports 8.5 report.
My DB is MySQL.
When I try to open the report from a VB6 application I'm told my access is denied - no password.
I fill in the password in the ODBC driver DSN configuration form
(and all is good - I test the connection and it works fine) and hit OK and save the report, it doesn't seems to solve the problem.
I build an ADO connection string (my preferred way) but it doesn't seemed to be saved with the report either.
How do I save the ODBC connection details with the report or set it by code?

Thanx
0
Question by:Etzie
    1 Comment
     
    LVL 13

    Accepted Solution

    by:
    If you're using the OCX (Crystal Report Control), use the Connect property:

    With CrystalReport1
        .ReportFileName = "C:\YourReport.rpt"
        .Connect = "DSN=ODBC_DSN_Name;UID=Username;PWD=Password;DBQ=dbName"
        .Action = 1
    End With

    With the RDC (Report Designer Component) use the SetLogOnInfo method:

    crxRpt.Database.Tables(1).SetLogOnInfo strServerOrDSNName, strDBNameOrPath, strUserID, strPassword

    -dave
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Shellfire Box VPN + Lifetime Subscription

    The Shellfire Box easily connects all of your devices, even those that don't offer the possibility to establish a safe vpn connection. Access blocked content and surf safely, no matter where in the world you are located.

    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    933 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now