By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,395 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

solve the error

100+
P: 284
i am using vb6 and crystal report ten ms access 2003

i had made a password in my access .now when i uses the following code its give me error that invalid password
i am filtering the crystal report with the following code

Expand|Select|Wrap|Line Numbers
  1.  
  2. invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invnotxt & ""
  3.  
so how to correct the code to open query in password protected access
May 25 '08 #1
Share this Question
Share on Google+
4 Replies


lotus18
100+
P: 866
i am using vb6 and crystal report ten ms access 2003

i had made a password in my access .now when i uses the following code its give me error that invalid password
i am filtering the crystal report with the following code

Expand|Select|Wrap|Line Numbers
  1.  
  2. invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invnotxt & ""
  3.  
so how to correct the code to open query in password protected access
Hi

As much as possible, avoid spaces with your fieldname and I removed the extra & "".

Expand|Select|Wrap|Line Numbers
  1.  invoicerep.SQLQueryString = "select * from salessummary where [invoice_no]=" & invnotxt 
May I see your codes for setting your access connection.

Rey Sean
May 25 '08 #2

QVeen72
Expert 100+
P: 1,445
Hi,

If you have newly created the Password to Access Db, then you need to pass password in to the crystal report(Thru connect property)..
Which version of CR..?

Regards
Veena
May 26 '08 #3

100+
P: 284
i am using crystal report 10

now if i removed the password the code works fine and show no error

but if i made password to access then this code show error.
the error is

Expand|Select|Wrap|Line Numbers
  1.  Run time error 
  2.  
  3. Logno failed
  4. Details DAO Error code: 0xbd7
  5. Source DAO Workspace
  6. Description Not a valid password
  7.  


the code for connecting to acces (i made a connection in module as
public)

Expand|Select|Wrap|Line Numbers
  1. Set con = New Connection
  2. Dim datapath As String
  3. datapath = App.path & "\Orders.mdb"
  4. con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & datapath & ";Persist Security Info=False; Jet OLEDB:Database Password=mypasword"
and code for filtering crystal report query is

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Screen.MousePointer = vbHourglass
  3. invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invoicefil.invnotxt & ""
  4. CRViewer1.ReportSource = invoicerep
  5. CRViewer1.ViewReport
  6. CRViewer1.DisplayTabs = False
  7. Screen.MousePointer = vbDefault
  8. End Sub
  9.  
when i click on dubug the code i was pointed to the following field
Expand|Select|Wrap|Line Numbers
  1. invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invoicefil.invnotxt & ""
remember in crystal report desingner using database expert
when i made a connection to acces i give password to it
can you solve what is the error now or what thing i am missing











Hi,

If you have newly created the Password to Access Db, then you need to pass password in to the crystal report(Thru connect property)..
Which version of CR..?

Regards
Veena
May 26 '08 #4

QVeen72
Expert 100+
P: 1,445
Hi,

You need to set password info to CR.
This works for CR 9, any way you can try it..

Expand|Select|Wrap|Line Numbers
  1. dim MyCr As CRAXDRT.ConnectionProperties
  2. Screen.MousePointer = vbHourglass
  3. Set MyCr =invoicerep.Database.Tables.Item(1).ConnectionProperties
  4. MyCr("Password") = "MyPassWord"
  5. invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invoicefil.invnotxt & ""
  6. CRViewer1.ReportSource = invoicerep
  7. CRViewer1.ViewReport
  8. CRViewer1.DisplayTabs = False
  9. Screen.MousePointer = vbDefault
  10.  
Regards
Veena
May 26 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.