Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 24th, 2003, 02:47 PM
Authorized User
 
Join Date: Jul 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting to MS SQL Crystal Report 9 from VB6

Hi.
I am calling my Crystal Report file from my VB6 code. Report is using data from MS SQL 2000 database. My code look like this:
 Dim connProp As CRAXDRT.ConnectionProperties

    Set m_Application = New CRAXDRT.Application
    Set m_Report = New CRAXDRT.Report

    Set m_Report = m_Application.OpenReport(App.Path & "\Report.rpt")
    Set connProp = m_Report.Database.Tables.item(1).ConnectionPropert ies

    connProp("DSN") = "ServerName"
    connProp("Database") = "DatabaseName"
    connProp("User ID") = "my_login"
    connProp("Password") = "my_password"

 I get an error message:

"Automation error
The object invoked has disconnected from its clients."

Thank you for your help

 
Old September 16th, 2003, 06:59 AM
Registered User
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please try to Add the following Declaration statement
I feel that is the problem.

Dim m_Application As CRAXDDRT.Application






Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report & VB6 & SQL Server wlho VB How-To 2 June 5th, 2013 01:58 AM
VB6 w/ Crystal Report cbowles VB How-To 1 December 23rd, 2006 02:10 AM
connecting database to crystal report using sqlser saif44 ASP.NET 2.0 Professional 3 March 24th, 2006 01:52 AM
Crystal Report 4.6 in vb6 alaa_h78 Beginning VB 6 2 November 22nd, 2005 09:31 PM
Crystal report 9 on VB6 mahanama VB How-To 2 February 1st, 2005 09:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.