Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I connect report with MS Access that set Database Password ?

Status
Not open for further replies.

SBh

Programmer
Jul 4, 2001
9
US

First, I can use following code (Visual Basic 6) to connect my database. It work well.
But after I set the Database Password, I can't use this code anymore.
When I run program, it show run time error '20997' ( I can not read the description ).
I don't know how can I set Database Password to connect the database
If anyone know, Please tell me.
Thank you so much for your help.

Here's my code :
With CrystalReport
.ReportFileName = App.Path & "MyReport.rpt"
.Connect = App.Path & "MyDB.dbf"
.SQLQuery = "SELECT * FROM MyTable ORDER BY A,B,C"
.SelectionFormula = "{MyTable.Selected} = YES"
.Action = 1
End With
 
Hi,
Try...
Code:
 With CrystalReport
        .PassWord ="password"
        .ReportFileName = App.Path & "MyReport.rpt"
        .Connect = App.Path & "MyDB.dbf"
        .SQLQuery = "SELECT * FROM MyTable ORDER BY A,B,C"
        .SelectionFormula = "{MyTable.Selected} = YES"
        .Action = 1
    End With
[code]
 

Thank you JCooL .. I already try but it still doesn't work.
Don't know why ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top