Showing posts with label call. Show all posts
Showing posts with label call. Show all posts

Friday, February 17, 2012

Error

Hello,

Following is the code written to call a crystal report having records for branch 3 only:

Dim appl As New CRAXDRT.Application
Dim rpt As New CRAXDRT.Report
Dim dat As CRAXDRT.Database

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Set rpt = appl.OpenReport(app.path & "\password.rpt", 1)

Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "dsn=invdet"
rs.Open "select * from table1 where branch=3", cn, adOpenStatic, adLockPessimistic

Set dat = rpt.Database
dat.SetDataSource rs, 3, 1
CR.ReportSource = rpt
CR.ViewReport

Error:

The Report shows all the records from "table1". It resembles the same report when I run from Crystal Reports.

i.e. it is not reporting for the above recordset set.My changes are in Bold.

'Get rid of these
'Dim appl As New CRAXDRT.Application
'Dim rpt As New CRAXDRT.Report
'Dim dat As CRAXDRT.Database

Dim Report as CrystalReport1 'This is the dsr file that you create

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Set rpt = appl.OpenReport(app.path & "\password.rpt", 1)

Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "dsn=invdet"
rs.Open "select * from table1 where branch=3", cn, adOpenStatic, adLockPessimistic

Report.SetDataSource rs, 3, 1
'Make sure CR is the name of the CrystalViewer on your form
CR.ReportSource = Report
CR.ViewReport|||I do not know how to create the dsr file|||What version of Crystal Reports are you using?|||I am using version 8.5|||I'm using version 8.5 Developer Edition. When I installed it, it placed all the necessary dlls on my comuter for me.

To create a dsr file, All I have to do is click 'Project', 'Add Crystal Reports 8.5'. Then follow the directions to create a dsr file.

Wednesday, February 15, 2012

Errocde = 3

Hi..
I wrote a StoreProcedure and use delphi to call it. if I am admin it run OK,
if I use normal user system will display error message like :
gereral SQL error
[MICROSOFT][ODBC SQL server Driver][SQL server]string or binary
data would
be trunated
[MicroSoft][ODBC SQL server Driver][SQL Server]the statement has
been
terminted
[MicroSoft][ODBC SQL server Driver][SQL Server]errocde = 3
What's problem?how to solved it'
ThanksCan you reproduce this by running the code from within Query Analyzer?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"James" <James@.discussions.microsoft.com> wrote in message
news:E4DC72AA-BC62-42F7-8552-6BB9212BFD4D@.microsoft.com...
> Hi..
> I wrote a StoreProcedure and use delphi to call it. if I am admin it run O
K,
> if I use normal user system will display error message like :
> gereral SQL error
> [MICROSOFT][ODBC SQL server Driver][SQL server]string or binar
y data would
> be trunated
> [MicroSoft][ODBC SQL server Driver][SQL Server]the statement h
as been
> terminted
> [MicroSoft][ODBC SQL server Driver][SQL Server]errocde = 3
> What's problem?how to solved it'
> Thanks
>

Errocde = 3

Hi..
I wrote a StoreProcedure and use delphi to call it. if I am admin it run OK,
if I use normal user system will display error message like :
gereral SQL error
[MICROSOFT][ODBC SQL server Driver][SQL server]string or binary data would
be trunated
[MicroSoft][ODBC SQL server Driver][SQL Server]the statement has been
terminted
[MicroSoft][ODBC SQL server Driver][SQL Server]errocde = 3
What's problem?how to solved it?
Thanks
Can you reproduce this by running the code from within Query Analyzer?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"James" <James@.discussions.microsoft.com> wrote in message
news:E4DC72AA-BC62-42F7-8552-6BB9212BFD4D@.microsoft.com...
> Hi..
> I wrote a StoreProcedure and use delphi to call it. if I am admin it run OK,
> if I use normal user system will display error message like :
> gereral SQL error
> [MICROSOFT][ODBC SQL server Driver][SQL server]string or binary data would
> be trunated
> [MicroSoft][ODBC SQL server Driver][SQL Server]the statement has been
> terminted
> [MicroSoft][ODBC SQL server Driver][SQL Server]errocde = 3
> What's problem?how to solved it?
> Thanks
>

Errocde = 3

Hi..
I wrote a StoreProcedure and use delphi to call it. if I am admin it run OK,
if I use normal user system will display error message like :
gereral SQL error
[MICROSOFT][ODBC SQL server Driver][SQL server]string or binary data would
be trunated
[MicroSoft][ODBC SQL server Driver][SQL Server]the statement has been
terminted
[MicroSoft][ODBC SQL server Driver][SQL Server]errocde = 3
What's problem?how to solved it'
ThanksCan you reproduce this by running the code from within Query Analyzer?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"James" <James@.discussions.microsoft.com> wrote in message
news:E4DC72AA-BC62-42F7-8552-6BB9212BFD4D@.microsoft.com...
> Hi..
> I wrote a StoreProcedure and use delphi to call it. if I am admin it run OK,
> if I use normal user system will display error message like :
> gereral SQL error
> [MICROSOFT][ODBC SQL server Driver][SQL server]string or binary data would
> be trunated
> [MicroSoft][ODBC SQL server Driver][SQL Server]the statement has been
> terminted
> [MicroSoft][ODBC SQL server Driver][SQL Server]errocde = 3
> What's problem?how to solved it'
> Thanks
>