Hi All
I am new to MSDE/SQL Server and need some guidance on best practices for
user permissions.
I have a VB6 program running in a bakery factory
The computer network is a peer to peer 3 computer network running WIndowsXP
MSDE runs on computer A and the data entry person runs my program on this
machine to enter daily orders for their customers
A manager needs to access the MSDE data from another computer for reporting
tasks and is not allowed to enter or modify data
I am sure I can't use Windows authentication as it is only a peer network.
Is this correct?
Should I create a new Login and set individual permissions on each table or
is it OK to use the sa account etc?
Any ideas appreciated
Regards
Steve> I am sure I can't use Windows authentication as it is only a peer network.
> Is this correct?
Windows authentication is problematic when you have multiple computers
without a domain. It is possible by mapping a drive on the client to the
SQL Server using a local server account but this is a kluge.
> Should I create a new Login and set individual permissions on each table
> or
> is it OK to use the sa account etc?
I suggest you use SQL authentication and assign permissions to roles. You
can prompt for the user's SQL login and password during application at
startup. Never use the 'sa' login for routine application access.
USE MyDatabase
--setup role-based security
EXEC sp_addrole 'Manager'
EXEC sp_addrole 'Clerk'
GRANT SELECT ON MyTable TO Manager
GRANT SELECT, INSERT, UPDATE, DELETE ON MyOtherTable TO Manager
GRANT SELECT ON MyOtherTable TO Clerk
--create login for managers
EXEC sp_addlogin 'SomeManager', 'SomeManagerPassword', 'MyDatabase'
EXEC sp_grantdbaccess 'SomeManager'
EXEC sp_addrolemember 'Manager', 'SomeManager'
--create login for clerks
EXEC sp_addlogin 'SomeClerk', 'SomeClerkPassword', 'MyDatabase'
EXEC sp_grantdbaccess 'SomeClerk'
EXEC sp_addrolemember 'Clerk', 'SomeClerk'
Hope this helps.
Dan Guzman
SQL Server MVP
"Steve" <Steve@.discussions.microsoft.com> wrote in message
news:6DE28FBB-20B4-4637-BC82-7BDDD9FDA62B@.microsoft.com...
> Hi All
> I am new to MSDE/SQL Server and need some guidance on best practices for
> user permissions.
> I have a VB6 program running in a bakery factory
> The computer network is a peer to peer 3 computer network running
> WIndowsXP
> MSDE runs on computer A and the data entry person runs my program on this
> machine to enter daily orders for their customers
> A manager needs to access the MSDE data from another computer for
> reporting
> tasks and is not allowed to enter or modify data
> I am sure I can't use Windows authentication as it is only a peer network.
> Is this correct?
> Should I create a new Login and set individual permissions on each table
> or
> is it OK to use the sa account etc?
> Any ideas appreciated
> --
> Regards
> Steve
Showing posts with label vb6. Show all posts
Showing posts with label vb6. Show all posts
Sunday, March 11, 2012
Sunday, February 12, 2012
beginner here help me
hello friends,
I have been asked to work on crystal reports on vb6.0. I want very begginner level examples to understand and learn crystal reports.
any help will be appreciated,
varshaVarsha,
See Crystal Reports help for better understanding. Be strong in Formula, Parameter concepts. Refer this also http://www.uk.businessobjects.com/products/reporting/crystalreports/default.asp
I have been asked to work on crystal reports on vb6.0. I want very begginner level examples to understand and learn crystal reports.
any help will be appreciated,
varshaVarsha,
See Crystal Reports help for better understanding. Be strong in Formula, Parameter concepts. Refer this also http://www.uk.businessobjects.com/products/reporting/crystalreports/default.asp
Beginner - Help needed in parameter passing
Hello,
I want to pass the parameter from VB6 to crystal report to get the reports. I want to pass the string and date parameters. I tried. But, I am getting errors. Pl. help and give the syntax for passing (both the types of parameters).To pass a string
Cr.Parameter(0)='" & string & "'
To pass a Date
Cr.Parameter(0)=#" & date & "#|||When passing parameters like the one you give, it shows syntax error (expecting expression) during the run time. Is anything has to be done in CR?|||Which version of CR you are using?|||CR version 8.5. VB 6 - Actually there is no "parameter" property. I selected parameter field property. It shows the syntax error. When parameter alone is given it shows "missing expression" error. Pl. help .
Meenakshi.R|||Pl. help me in parameter passing. I used the following code
crystalreport1.selectionformula="{servmst.mrtcd}=' "&wmrtcd&" ' "
by following a book I referred. wmrtcd is the variable I assigned to get the value at run time. But the code shows the error message 'Syntax error'. Pl. help me in completion of my project|||What is the datatype of mrtcd?
If it is numeric, then
crystalreport1.selectionformula="{servmst.mrtcd}= "&val(wmrtcd)&""|||wmrtcd is a string value. I typed like this
CrystalReport1.SelectionFormula = "{servmst.mrtcd}= "&wmrtcd&""
It shows syntax error.|||Anybody Pl. help me in parameter passing.|||How about using Selection formula from the menu?
Open the report goto Report->Selection Formulas->Record
then write this code
{servmst.mrtcd}= parametername|||Sir,
I wrote the code as you given. But whenever I select the parameter from the VB code it displays the first record only. What to do? But I am selecting some other record. Here I have listed the code I used. Pl. guide me
Private Sub Cmd_run_Click()
MsgBox wmrtcd
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.Action = 1
With the message box, I can get the parameter I selected.|||Hi!
plz try this format
String :
---
wmrtcd="{emp_det.emp_id} = '"& trim(your_id) &"'"
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2
Numeric :
----
wmrtcd="{emp_det.emp_id} = "& trim(your_id) &""
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2
Date :
---
Dim da, str As Variant
Dim a, b, c, e As Variant
da=cdate(rsEmp.fields("emp_det.emp_doj").value)
a = Day(da.Value)
b = Month(da.Value)
c = Year(da.Value)
d = "#" & c & "/" & b & "/" & a & "#"
wmrtcd="{emp_det.emp_doj} = '"& d &"'"
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2
note : crystal report date format is "YYYY/MM/DD"|||Hi,
I can't understand what is "your_id". But I tried this code
MsgBox wmrtcd
wmrtcd = "{servmst.mrtcd} = '" & Trim(wmrtcd) & "'"
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 1
It shows the following error.
Run Time error '20515'
Error in file f:\meena\project\test\sermst.rpt
Error in formula <Record_Selection>
' The remaining text does not appear to be part of the formula.
What to do? Pl. help me.|||Make sure you have given the correct column name|||Hi!
Its a Parameter Value.
EmpID='ii-0406'
EmpSal=6000
EmpDoj="13/09/2004"
String :
---
wmrtcd="{emp_det.emp_id} = '"& trim(EmpID) &"'"
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2
Numeric :
----
wmrtcd="{emp_det.emp_id} = "& trim(EmpSal) &""
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2
Date :
---
Dim da, str As Variant
Dim a, b, c, e As Variant
da=cdate(EmpDoj)
a = Day(da.Value)
b = Month(da.Value)
c = Year(da.Value)
d = "#" & c & "/" & b & "/" & a & "#"
wmrtcd="{emp_det.emp_doj} = '"& d &"'"
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2|||Hai,
I tried with the following code.
MsgBox wmrtcd
wsel = "{servmst.mrtcd} = '" & Trim(wmrtcd) & "'"
MsgBox wsel
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wsel
But still gets the same error. With the mesg box it shows
servmst.mrtcd='A001'
When debugging the error, it shows
wsel = "{servmst.mrtcd}='A001'" (when mouse is dragged over the line.
Pl. help me from coming out of this problem.
Regards|||Hi! see this link
http://support.businessobjects.com/library/kbase/articles/c2010935.asp
else
plz try to add the report as dsr.
1) Visual Basic -->Project Explorere-->Add-->More ActiveXdesigner-->Crystal Reports8.5
then customize ur report as u like.
i am attaching a sample report here plz see this.
regards
muthu|||Hai,
I have included that crystal report using designer. But how to name the object "Crystal viewer". In the sample code it is written as crviewer1. I have tried with crystalviewer, crviewer. But whatever I type it shows " No object". Pl. help.
Regards|||Help me in completion of the project|||You need to use Crystal Viewer and use that name in the code|||Hi! see this link
http://support.businessobjects.com/library/kbase/articles/c2010935.asp
else
plz try to add the report as dsr.
1) Visual Basic -->Project Explorere-->Add-->More ActiveXdesigner-->Crystal Reports8.5
then customize ur report as u like.
i am attaching a sample report here plz see this.
regards
muthu
I want to pass the parameter from VB6 to crystal report to get the reports. I want to pass the string and date parameters. I tried. But, I am getting errors. Pl. help and give the syntax for passing (both the types of parameters).To pass a string
Cr.Parameter(0)='" & string & "'
To pass a Date
Cr.Parameter(0)=#" & date & "#|||When passing parameters like the one you give, it shows syntax error (expecting expression) during the run time. Is anything has to be done in CR?|||Which version of CR you are using?|||CR version 8.5. VB 6 - Actually there is no "parameter" property. I selected parameter field property. It shows the syntax error. When parameter alone is given it shows "missing expression" error. Pl. help .
Meenakshi.R|||Pl. help me in parameter passing. I used the following code
crystalreport1.selectionformula="{servmst.mrtcd}=' "&wmrtcd&" ' "
by following a book I referred. wmrtcd is the variable I assigned to get the value at run time. But the code shows the error message 'Syntax error'. Pl. help me in completion of my project|||What is the datatype of mrtcd?
If it is numeric, then
crystalreport1.selectionformula="{servmst.mrtcd}= "&val(wmrtcd)&""|||wmrtcd is a string value. I typed like this
CrystalReport1.SelectionFormula = "{servmst.mrtcd}= "&wmrtcd&""
It shows syntax error.|||Anybody Pl. help me in parameter passing.|||How about using Selection formula from the menu?
Open the report goto Report->Selection Formulas->Record
then write this code
{servmst.mrtcd}= parametername|||Sir,
I wrote the code as you given. But whenever I select the parameter from the VB code it displays the first record only. What to do? But I am selecting some other record. Here I have listed the code I used. Pl. guide me
Private Sub Cmd_run_Click()
MsgBox wmrtcd
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.Action = 1
With the message box, I can get the parameter I selected.|||Hi!
plz try this format
String :
---
wmrtcd="{emp_det.emp_id} = '"& trim(your_id) &"'"
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2
Numeric :
----
wmrtcd="{emp_det.emp_id} = "& trim(your_id) &""
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2
Date :
---
Dim da, str As Variant
Dim a, b, c, e As Variant
da=cdate(rsEmp.fields("emp_det.emp_doj").value)
a = Day(da.Value)
b = Month(da.Value)
c = Year(da.Value)
d = "#" & c & "/" & b & "/" & a & "#"
wmrtcd="{emp_det.emp_doj} = '"& d &"'"
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2
note : crystal report date format is "YYYY/MM/DD"|||Hi,
I can't understand what is "your_id". But I tried this code
MsgBox wmrtcd
wmrtcd = "{servmst.mrtcd} = '" & Trim(wmrtcd) & "'"
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 1
It shows the following error.
Run Time error '20515'
Error in file f:\meena\project\test\sermst.rpt
Error in formula <Record_Selection>
' The remaining text does not appear to be part of the formula.
What to do? Pl. help me.|||Make sure you have given the correct column name|||Hi!
Its a Parameter Value.
EmpID='ii-0406'
EmpSal=6000
EmpDoj="13/09/2004"
String :
---
wmrtcd="{emp_det.emp_id} = '"& trim(EmpID) &"'"
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2
Numeric :
----
wmrtcd="{emp_det.emp_id} = "& trim(EmpSal) &""
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2
Date :
---
Dim da, str As Variant
Dim a, b, c, e As Variant
da=cdate(EmpDoj)
a = Day(da.Value)
b = Month(da.Value)
c = Year(da.Value)
d = "#" & c & "/" & b & "/" & a & "#"
wmrtcd="{emp_det.emp_doj} = '"& d &"'"
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wmrtcd
CrystalReport1.Action = 2|||Hai,
I tried with the following code.
MsgBox wmrtcd
wsel = "{servmst.mrtcd} = '" & Trim(wmrtcd) & "'"
MsgBox wsel
CrystalReport1.ReportFileName = "f:\meena\project\test\sermrtcd.rpt"
CrystalReport1.SelectionFormula = wsel
But still gets the same error. With the mesg box it shows
servmst.mrtcd='A001'
When debugging the error, it shows
wsel = "{servmst.mrtcd}='A001'" (when mouse is dragged over the line.
Pl. help me from coming out of this problem.
Regards|||Hi! see this link
http://support.businessobjects.com/library/kbase/articles/c2010935.asp
else
plz try to add the report as dsr.
1) Visual Basic -->Project Explorere-->Add-->More ActiveXdesigner-->Crystal Reports8.5
then customize ur report as u like.
i am attaching a sample report here plz see this.
regards
muthu|||Hai,
I have included that crystal report using designer. But how to name the object "Crystal viewer". In the sample code it is written as crviewer1. I have tried with crystalviewer, crviewer. But whatever I type it shows " No object". Pl. help.
Regards|||Help me in completion of the project|||You need to use Crystal Viewer and use that name in the code|||Hi! see this link
http://support.businessobjects.com/library/kbase/articles/c2010935.asp
else
plz try to add the report as dsr.
1) Visual Basic -->Project Explorere-->Add-->More ActiveXdesigner-->Crystal Reports8.5
then customize ur report as u like.
i am attaching a sample report here plz see this.
regards
muthu
Subscribe to:
Posts (Atom)