3 Replies - 5552 Views - Last Post: 07 January 2009 - 03:41 AM Rate Topic: -----

#1 muddasir  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 8
  • View blog
  • Posts: 114
  • Joined: 14-January 07

How to bind password protectec access to crystal report using vb6

Posted 06 January 2009 - 09:10 AM

I am using vb6 and crystal report 10 for report generation , also using ms access 2000 as a backend database.

i had put password to the database and when i run my report i am getting message "Invalid password" as i check i had provide the true password and if i remove the password the report run fine .

I also want that the report use data from application path and not the fix path.

I am using the following code

Private Sub Form_Load()
Report1.Database.Tables(1).SetSessionInfo "", Chr(10) & "abc123"
Report1.Database.Tables(1).Location = App.Path & "\My Project.mdb"
Screen.MousePointer = vbHourglass
Report1.SQLQueryString = "select * from Sales"
CRViewer1.ReportSource = Report1
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End sub


what wrong in this code , when i remove the password report works fine if i put the password it says invalid password.

any help ?

This post has been edited by PsychoCoder: 06 January 2009 - 10:18 AM


Is This A Good Question/Topic? 0
  • +

Replies To: How to bind password protectec access to crystal report using vb6

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to bind password protectec access to crystal report using vb6

Posted 06 January 2009 - 10:22 AM

I'm assuming you added a username and password to your MDB file, if so then it is expecting a username and a password

Report1.Database.Tables(1).SetSessionInfo "YourUserID", Chr(10) &  "abc123"



Replace YourUserID with the username on your MDB file
Was This Post Helpful? 0
  • +
  • -

#3 muddasir  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 8
  • View blog
  • Posts: 114
  • Joined: 14-January 07

Re: How to bind password protectec access to crystal report using vb6

Posted 06 January 2009 - 10:38 PM

i did not use any user name while creating access password.
Was This Post Helpful? 0
  • +
  • -

#4 muddasir  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 8
  • View blog
  • Posts: 114
  • Joined: 14-January 07

Re: How to bind password protectec access to crystal report using vb6

Posted 07 January 2009 - 03:41 AM

I got the mistake i am making and solved it

Thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1