Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
Crystal Reports e reportistica
[B.NET] Crystal report e password database
martedì 20 aprile 2004 - 18.18
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
amello
Profilo
| Newbie
3
messaggi | Data Invio:
mar 20 apr 2004 - 18:18
salve
ho un problema ho creato un report per un database access con password, all'avvio dell'applicazione mi compare sempre una schermata che mi chiede la password del database, come posso evitare ciò? Grazie, uso vb.net 2003
freeteo
Profilo
| Guru
6.542
messaggi | Data Invio:
mar 20 apr 2004 - 18:36
ciao,
puoi provare ad impostare 1po di proprieta della "LogOnInfo" delle tue tabelle, ti posto il codice che ho usato io in 1prj "vecchietto":
CrystalDecisions.Shared.TableLogOnInfo zLogOnInfo = zRpt.Database.Tables[0].LogOnInfo;
zLogOnInfo.ConnectionInfo.ServerName = @".\netsdk";
zLogOnInfo.ConnectionInfo.DatabaseName = "dbprova";
zLogOnInfo.ConnectionInfo.UserID = "sa";
zLogOnInfo.TableName = "news";
zRpt.Database.Tables[0].ApplyLogOnInfo(zLogOnInfo);
crystalReportViewer1.ReportSource = zRpt;
spero funzioni ancora...
ciao ;-)
freeteo
Profilo
| Guru
6.542
messaggi | Data Invio:
mar 20 apr 2004 - 19:06
opss...
scusa si attacca a sql, cmq prova a guardare se puo tornare utile anche con access...
Brainkiller
Profilo
| Guru
7.999
messaggi | Data Invio:
mer 21 apr 2004 - 01:42
Prova con questo codice:
Dim crReportDocument As New ReportDocument
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo
crReportDocument.Load("C:\Report1.rpt")
crConnectionInfo = New ConnectionInfo
With crConnectionInfo
'Use the ServerName Property if the report
'connects through OLEDB
.ServerName = "C:\Databases\xtreme.mdb"
'Use the DatabaseName Property if the
'report connects through ODBC
.DatabaseName = "C:\Databases\xtreme.mdb"
End With
crTables = crReportDocument.Database.Tables
For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next
CrystalReportViewer1.ReportSource = crReportDocument
e riempi l'oggetto TableLogOnInfo con userid e password, dovrebbe andare.
ciao
david
totti240282
Profilo
| Guru
1.574
messaggi | Data Invio:
mer 9 mar 2005 - 09:16
ok cosi anche sembra andare anche se si può semplificare il tutto ,con solo TableLogOnInfo ,per poi applicarlo al report.
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !