solve the error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muddasirmunir
    Contributor
    • Jan 2007
    • 284

    solve the error

    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

    Code:
     
    invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invnotxt & ""
    so how to correct the code to open query in password protected access
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Originally posted by muddasirmunir
    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

    Code:
     
    invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invnotxt & ""
    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 & "".

    Code:
     invoicerep.SQLQueryString = "select * from salessummary where [invoice_no]=" & invnotxt
    May I see your codes for setting your access connection.

    Rey Sean

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      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

      Comment

      • muddasirmunir
        Contributor
        • Jan 2007
        • 284

        #4
        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

        Code:
         Run time error 
         
        Logno failed
        Details DAO Error code: 0xbd7
        Source DAO Workspace
        Description Not a valid password


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

        Code:
        Set con = New Connection
        Dim datapath As String
        datapath = App.path & "\Orders.mdb"
        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

        Code:
        Private Sub Form_Load()
        Screen.MousePointer = vbHourglass
        invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invoicefil.invnotxt & ""
        CRViewer1.ReportSource = invoicerep
        CRViewer1.ViewReport
        CRViewer1.DisplayTabs = False
        Screen.MousePointer = vbDefault
        End Sub
        when i click on dubug the code i was pointed to the following field
        Code:
        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











        Originally posted by QVeen72
        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

        Comment

        • QVeen72
          Recognized Expert Top Contributor
          • Oct 2006
          • 1445

          #5
          Hi,

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

          [CODE=vb]
          dim MyCr As CRAXDRT.Connect ionProperties
          Screen.MousePoi nter = vbHourglass
          Set MyCr =invoicerep.Dat abase.Tables.It em(1).Connectio nProperties
          MyCr("Password" ) = "MyPassWord "
          invoicerep.SQLQ ueryString = "select * from salessummary where [invoice no]=" & invoicefil.invn otxt & ""
          CRViewer1.Repor tSource = invoicerep
          CRViewer1.ViewR eport
          CRViewer1.Displ ayTabs = False
          Screen.MousePoi nter = vbDefault
          [/CODE]

          Regards
          Veena

          Comment

          Working...