Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
| Search | Today's Posts | Mark Forums Read
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases 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 September 30th, 2005, 11:22 PM
Authorized User
 
Join Date: Aug 2003
Location: Kolkata, West Bengal, India.
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Kaustav Send a message via Yahoo to Kaustav
Default Passwrd protected mdb file from Crystl Rpt in vb6

Plz help. Its urgent. When i m trying to connect an access database using crystal report viewer in vb6 I am getting an error saying "not a valid password". I have tried OLEDB, Access(dao) connections from crystalreport1 designer control. But in vain.

PLz give me a through detail about how can i solve this problem.
Note: my database report can be opened directly by crystal report directly without going through vb6.

Bye

------------------
Kaustav
__________________
------------------
Kaustav
 
Old October 24th, 2005, 08:08 PM
Registered User
 
Join Date: Oct 2005
Location: Miami, FL, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need to prepend a linefeed character to the password for it to work, see the example below:


Dim mCRXReport As CRAXDRT.Report
Dim crxTable As CRAXDRT.DatabaseTable

Set mCRXReport = mcrxApplication.OpenReport _
                    ("MyFolder\MyReport.rpt", 1)

    For Each crxTable In mCRXReport.Database.Tables
        'The next line just supplies the database location
        crxTable.SetTableLocation "c:\MyStuff\MyData.mdb", "", ""
        'Add a linefeed to your password
        crxTable.SetSessionInfo "", Chr(10) & "MyPassword"
    Next crxTable

Best Regards,

Al Weisenborn




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create database (.mdb) file in vb6 code mrleokarthik Pro VB 6 13 August 7th, 2009 11:39 AM
Crystal Report 9 password protected mdb ACCESS sajid_rauf Pro VB Databases 2 July 27th, 2007 02:29 AM
Change Printer at run time for crystal rpt, VB6.0 fiiyo ASP.NET 1.0 and 1.1 Basics 0 September 19th, 2006 06:58 AM
Open mde or mdb access file from vb6 gorgo Pro VB 6 1 February 20th, 2006 01:39 AM
Clearing all records in an .mdb table from VB6 rwheeler Pro VB Databases 5 December 9th, 2004 03:23 PM





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