Crystal data object cannot open SQL server 
Author Message
 Crystal data object cannot open SQL server

Hi,
 have generated a Crystal Report using crystal 8 the report uses 4 tables
from the same database. They are connected using the Microsoft SQL server
option in the "More Data Sources". If i try and run the reports using the
data object the code below fails on the crrep.preview line. giving the
following error

err.number 20599
err.description Cannot open SQL server.

The  SQLSvr.err file shows

SQL Server Message
 Number  : 18456
 State   : 1
 Severity: 14
 Text    : Login failed for user 'I8EPOS_Reporter'.
 Server  :

I am passing the report the same logon criteria as that defined in the
report, any ideas?

Dim cr As CRPEAuto.Application
Dim crRep As CRPEAuto.Report

Set cr = New CRPEAuto.Application
On Error GoTo errortrap
    cr.LogOnServer "c:\windows\crystal\p2ssql.dll", "(Local)", _
                            "I8EPOS", "I8EPOS_Reporter", "password"
    Set crRep = cr.OpenReport(App.Path & "\Reports\" & sRep)
    crRep.Preview sRep
    Set crRep = Nothing
    Set cr = Nothing
    Exit Function
errortrap:

thanks greatly in advance

Tim B

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ( http://www.*-*-*.com/ ).
Version: 6.0.461 / Virus Database: 260 - Release Date: 10/03/2003



Tue, 30 Aug 2005 00:51:56 GMT  
 Crystal data object cannot open SQL server
Hi,
Please use the code given below. I hope it'll solve your
problem

On Error GoTo hlp
Dim tbl As CRAXDRT.DatabaseTable
For Each tbl In Report.Database.Tables
     tbl.SetLogOnInfo DBServer, DBDataBase, DBUser,
DBPassword
Next

Report.Database.LogOnServer "PDSSQL", DBServer,
DBDataBase, DBUser, DBPassword

regards,
jawahir

Quote:
>-----Original Message-----
>Hi,
> have generated a crystal report using crystal 8 the

report uses 4 tables
Quote:
>from the same database. They are connected using the

Microsoft SQL server
Quote:
>option in the "More Data Sources". If i try and run the
reports using the
>data object the code below fails on the crrep.preview
line. giving the
>following error

>err.number 20599
>err.description Cannot open SQL server.

>The  SQLSvr.err file shows

>SQL Server Message
> Number  : 18456
> State   : 1
> Severity: 14
> Text    : Login failed for user 'I8EPOS_Reporter'.
> Server  :

>I am passing the report the same logon criteria as that
defined in the
>report, any ideas?

>Dim cr As CRPEAuto.Application
>Dim crRep As CRPEAuto.Report

>Set cr = New CRPEAuto.Application
>On Error GoTo errortrap

cr.LogOnServer "c:\windows\crystal\p2ssql.dll", "(Local)",
_

- Show quoted text -

Quote:
>                            "I8EPOS", "I8EPOS_Reporter", "
password"
>    Set crRep = cr.OpenReport(App.Path & "\Reports\" &
sRep)
>    crRep.Preview sRep
>    Set crRep = Nothing
>    Set cr = Nothing
>    Exit Function
>errortrap:

>thanks greatly in advance

>Tim B

>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.461 / Virus Database: 260 - Release Date:
10/03/2003

>.



Wed, 31 Aug 2005 06:03:01 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Crystal Info V6 - Cannot open SQL server

2. Run-time error 20599: Cannot open SQL Server

3. Cannot Open SQL Server Error

4. Cannot open SQL server (CR 8)

5. Cannot Open SQL Server

6. CANNOT OPEN SQL server error ?

7. cannot open sql server error ???

8. Cannot open SQL server

9. *** HELP ** 20599 - Cannot open SQL Server

10. Cannot open SQL Server

11. Error 20599 - Cannot open SQL Server

12. Cannot open SQL Server error in CR 8

 

 
Powered by phpBB® Forum Software