|
-
Aug 22nd, 2007, 08:18 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Report vs Protected access database ???
Hi everybody !
I'm trying to open a report that uses datas from a protected access database and I'm unable ?
I checked on this forum and I found nothing that solves my problem...
Is someone could help me ?
I'm using VB6, Access 2003 et CR8.5
Code:
'Show the report
With CRpt1
.Password = Chr(10) & DatafilePwd
.ReportFileName = pathName(34)
.WindowTitle = "Estima 2007 - Bon de production"
.PrintReport
End With
Thanks in advance !
DubweiserTM

If your question has been answered, you can mark a thread as resolved...
-
Aug 22nd, 2007, 08:22 AM
#2
Re: Report vs Protected access database ???
What is the error message?
-Edit below
Are you using workgroup securtity?
Last edited by GaryMazzone; Aug 22nd, 2007 at 08:25 AM.
Reason: More infor for Secure DB
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Aug 22nd, 2007, 08:26 AM
#3
Thread Starter
Hyperactive Member
Re: Report vs Protected access database ???
 Originally Posted by GaryMazzone
What is the error message?
Nothing happen ???
About workgroup, I think no...Because, before I put a password on my database, the report was displayed...
DubweiserTM

If your question has been answered, you can mark a thread as resolved...
-
Aug 22nd, 2007, 08:27 AM
#4
Re: Report vs Protected access database ???
Did you step thopught the code using breadkpoints and F8? If it didn't work we need more info then Nothing happens.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Aug 22nd, 2007, 08:32 AM
#5
Thread Starter
Hyperactive Member
Re: Report vs Protected access database ???
 Originally Posted by GaryMazzone
Did you step thopught the code using breadkpoints and F8? If it didn't work we need more info then Nothing happens.
I tried that and vb pass over the line...
DubweiserTM

If your question has been answered, you can mark a thread as resolved...
-
Aug 22nd, 2007, 08:40 AM
#6
Re: Report vs Protected access database ???
So it never gets to the With CRpt1 line or the .Password line?
By the way I always hated CR with security on MS databases
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Aug 22nd, 2007, 08:45 AM
#7
Thread Starter
Hyperactive Member
Re: Report vs Protected access database ???
 Originally Posted by GaryMazzone
So it never gets to the With CRpt1 line or the .Password line?
By the way I always hated CR with security on MS databases
Oooppsss I did a mistake, Im not very good in english ! Vb pass on the line...
DubweiserTM

If your question has been answered, you can mark a thread as resolved...
-
Aug 22nd, 2007, 09:15 AM
#8
Thread Starter
Hyperactive Member
Re: Report vs Protected access database ???
Finally the solution is:
Report.Password = Chr(10) & "Password"
Im sorry GaryMazzone if I take your time, I forgot to change the path of my database in my report...Grrrrrrr ! Sorry again...
DubweiserTM

If your question has been answered, you can mark a thread as resolved...
-
Aug 22nd, 2007, 09:23 AM
#9
Re: [RESOLVED] Report vs Protected access database ???
I would normally do that in the code each time. That way the user can place the database anywhere they want and not have the problem. I think I have some code that did that with CR 8.5 I'll look.
-edit
Code:
Public Sub set_CR_Datatables(ByVal intNum as Integer)
Dim i as Integer
For i = 0 to intNum
frmMainForm.crRep.DataFiles(i) = gstrLoc & "\" & gstrDBName
Next i
End Sub
Ok some expliantion..
intNum is a number that tells the sub how many data tables are in the report.
gstrLoc is the Folder location of the database (stored in a Public string var)
gstrDBName is the Name of the Database to use (stored in a Public string var)
frmMainForm.crRep is the Crystal control (ocx) that is located on my main form (all reports use this one control)
Called like this:
Code:
Dim strRepName As String
Dim strRPName2 As String
Dim strW As String
Dim i as Integer
strW = vbNullString
If optPtoR.Value Then
strRepName = "WorkerToRoom.rpt" -- This is the Report Name to load
strRPName2 = "Locations Assiged to Worker" & vbCrLf & "Sorted By Worker" --This is the title for the report
strW = "{Person.WorkerType <> 10} -- Don't get Inactive Personnel
i= 5 -- 5 datatables in the report
ElseIf....
Else
Exit Sub
End If
frmMainForm.crRep.ReportTitle = strRPName2
frmMainForm.crRep.ReportFileName = App.Path & "\" & strRepname
mdlGeneral.set_CR_Datatables(i)
frmMainForm.crRep.ReplaceSelectionFormula strW
Last edited by GaryMazzone; Aug 22nd, 2007 at 09:35 AM.
Reason: Added some code
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Aug 22nd, 2007, 09:55 AM
#10
Thread Starter
Hyperactive Member
Re: [RESOLVED] Report vs Protected access database ???
Thank you very much for this lesson !
I will put that code in my program in few days...
DubweiserTM

If your question has been answered, you can mark a thread as resolved...
-
Mar 1st, 2008, 03:51 AM
#11
Lively Member
Re: Report vs Protected access database ???
Thanks it works good.
But wt to do if there is a subreport. it doesnt work
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|