473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to code loginID & password for Crystal report

I'm using ODBC DSN to create CR reports. The VP app keeps popping up login
dialog to ask for userID & password. I would like to be able to supply the
DSN id & password in VB.NET app instead. Any suggestion is greatly
appreciated.
Thanks
Bill
Nov 20 '05 #1
1 1632
Bill

My first suggestion is to ditch ODBC. The drawbacks of it far outweight the benefits. I recommend using either JET or OLEDB drivers to connect directly to your database. I don't know exactly what type of database you are using, so I will post for both Access and SQL Server. For Access databases, use JET 4.0 drivers. In the code, connect to your database like so

Dim oRpt As MyRepor
Dim oInfo As CrystalDecisions.Shared.TableLogOnInfo 'you must use a seperate variabl
Dim i As Intege

oRpt = New MyRepor
For i = 0 To oRpt.Database.Tables.Count -
oInfo = oRpt.Database.Tables(i).LogOnInf
oInfo.ConnectionInfo.ServerName = strPathToAccessMDBFil
oInfo.ConnectionInfo.UserID = "Admin
oInfo.ConnectionInfo.Password = "
oRpt.Database.Tables(i).ApplyLogOnInfo(oInfo
Nex

For SQL Server do something like this
oRpt = New EstimateSummar
For i = 0 To oRpt.Database.Tables.Count -
oInfo = oRpt.Database.Tables(i).LogOnInf
oInfo.ConnectionInfo.DatabaseName = strMyDbNam
oInfo.ConnectionInfo.Password = "
oInfo.ConnectionInfo.UserID = "
oInfo.ConnectionInfo.ServerName = strSQLServerNam
oRpt.Database.Tables(i).ApplyLogOnInfo(oInfo
Nex

'apply the login information to all the table
oRpt.SetDatabaseLogon(strUser, strPassword, strSQLServerName, strMyDbName

I hope this helps you fix your problem

Jason
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: webmaster | last post by:
I have a password protected Access Database (.MDB) file. I also have a Crystal Report with database fields connected to table in this database. I want to display the Crystal Report Preview Form...
2
by: Dougie | last post by:
I am obtaining a DataSet from an XML web service. It contains a number of ten pin bowling scores from 4 different players. I want to provide a means of graphing the performance of the round and...
0
by: Tom Gao | last post by:
Hi guys I got a prompt whilst installing Crystal Report Enterprise 10 that it prompted me to install Crystal Report Advanced Developer edition or something... I continued installing but I'm...
2
by: Maellic | last post by:
Hi, I'm currently updating a website written with ASP.NET. The original programmer is overseas, there is no documentation, and files are all over the place. Here is a code snippet from one of...
0
by: John Kastrinos | last post by:
Yes, I know this is more of a Crystal group question. I posted there about 2 weeks ago, but no one EVER replies over there. So, I thought I would take a shot here. If anyone has heard of this,...
3
by: Trichy | last post by:
Hi Can any one help me. I added crystal report item to my project .net. After connecting to database , i inserted three columns from table. I ran report in ..net is working fine. My problem, ...
1
by: riyaz | last post by:
i am new to .net environment, anyone can advise me how to create a crystal report ,how to connect to databse and to display in web page .As i m developing asp.net based web application i want...
1
by: John | last post by:
I'm trying to develop a crystal report page using inline code (no code behind page). Here is my code: <%@ Page language="c#" %> <%@ Register TagPrefix="cr" Namespace="CrystalDecisions.Web"...
0
by: Mark Gold | last post by:
Hi! We have a VB application using Crystal Reports 6 that has worked successfully on hundreds of systems for over 10 years. Now, on one network, the application and access database does not close....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.