
VB5, Crystal 4.6.1 -User Level Security password
Assuming that you have user security as well as a database password,
you must first open the workspace with a userid that your security
file recognizes:
DBEngine.SystemDB = "TheSecurityFile"
Set ws = DBEngine.CreateWorkspace("", "TheUserName",
"TheUserPassword")
Then you need to open the database with the database password:
Set db = ws.OpenDatabase("DBFilename",T/F, T/F,
";PWD=" & "TheDBPassword")
If your program doesn't know the password, prompt the user.
The report already knows the filename, so you don't need the
datafiles property.
If you want to run the report from a table other than the one you used
to create the report, you'll need to use ODBC and not native Jet.
Quote:
>Hey, can anybody help me with this? I created a big VB 5.0
>application on JET 3.5 database, for my client. It has a number of
>complicated Crystal Reports 4.6.1 which I am running with the Crystal
>Reports control on a form, like this:
>sCRWSelection = "{VeriFoneReports.VeriReportDate} = etc etc long...
>rptCRW.SelectionFormula = sCRWSelection
>rptCRW.DataFiles(0) = psDBPath_Filename
>rptCRW.ReportFileName = (App.Path + "\Cashiers.rpt")
>rptCRW.PrintFileName = (App.Path + "\GL.prn")
>rptCRW.Destination = 0
>rptCRW.Action = 1
>Worked beautiful, until they required User Level Security-- now the
>reports all return "Run-time error 20533, Unable to Open Database."
>I have been utterly unable to tweak these reports in any way to
>enable them to access the database: the .UserName and .Password
>properties have no effect.
>Will I need to create temporary unprotected MDB files, to print
>Crystal Reports from a secure database? I can't believe this....
>My security file is C:\...\MyFile.MDW
>(not C:\WinNT\System32\SYSTEM.MDW) --Do I need to tweak
>the Registry? Where can I find the fabled SysDB32.exe for tweaking
>the registry?
>Can somebody help me out please?
>* Todd F. Boyle CPA www.isomedia.com/homes/tboyle
>* 9745-128th Av NE, Kirkland WA 98033 (425) 827-3107
>* co-moderator biz.comp.accounting
>* It is illegal to send Unsolicited Commercial Email
>* to mailboxes in the State of Washington