473,473 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Connection String with Crystal

Posted this to vb.crystal and received no response.
----------------------------------------------------------------------------
I'm using VS 2003 and VB .NET along with the embedded version of
Crystal Reports. When I build and deploy my application, the Access db
that I use is stored in the directory containing the executable that
launches my program.

So that my application knows to find the access db in the same
directory as the executable when I ship the application, I use the
following in my connection string:
AppBase = AppDomain.CurrentDomain.BaseDirectory & "data.mdb"

Then I do this:

' Update our connection string
Me.OleDbConnection2.ConnectionString = "Jet OLEDB:Global
Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=" & AppBase & ";Jet OLEDB:Engine
Type=5;Provider=""Mic" & _
"rosoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet
OLEDB:SFP=False;persist sec" & _
"urity info=False;Extended Properties=;Mode=Share Deny
None;Jet OLEDB:Encrypt Dat" & _
"abase=False;Jet OLEDB:Create System Database=False;Jet
OLEDB:Don't Copy Locale o" & _
"n Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet" & _
" OLEDB:Global Bulk Transactions=1"

This works fine for my application...no problems.

However, I need to do the same for Crystal Reports so that it too
knows of the db location in a deployed application.

I cannot find in my code where the CR connection string is so I can
modify it in my code. How do I accomplish a modification of the CR db
connection string (at runtime?)?

Thanks a ton!
-Dan

Mar 16 '07 #1
4 5538
On Mar 16, 1:40 pm, "pooba53" <poob...@gmail.comwrote:
Posted this to vb.crystal and received no response.
---------------------------------------------------------------------------*-
I'm using VS 2003 and VB .NET along with the embedded version of
Crystal Reports. When I build and deploy my application, the Access db
that I use is stored in the directory containing the executable that
launches my program.

So that my application knows to find the access db in the same
directory as the executable when I ship the application, I use the
following in my connection string:
AppBase = AppDomain.CurrentDomain.BaseDirectory & "data.mdb"

Then I do this:

' Update our connection string
Me.OleDbConnection2.ConnectionString = "Jet OLEDB:Global
Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=" & AppBase & ";Jet OLEDB:Engine
Type=5;Provider=""Mic" & _
"rosoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet
OLEDB:SFP=False;persist sec" & _
"urity info=False;Extended Properties=;Mode=Share Deny
None;Jet OLEDB:Encrypt Dat" & _
"abase=False;Jet OLEDB:Create System Database=False;Jet
OLEDB:Don't Copy Locale o" & _
"n Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet" & _
" OLEDB:Global Bulk Transactions=1"

This works fine for my application...no problems.

However, I need to do the same for Crystal Reports so that it too
knows of the db location in a deployed application.

I cannot find in my code where the CR connection string is so I can
modify it in my code. How do I accomplish a modification of the CR db
connection string (at runtime?)?

Thanks a ton!
-Dan
http://www.codeproject.com/useritems/CrystalWin.asp
This does what you're looking for but it's in C#. Should be easy
enough to get it over to VB.NET. I've used it in my own code and it
works well.

Mar 17 '07 #2
I'm not seeing how this solves my problem.
-Dan

On Mar 16, 10:08 pm, "jayeldee" <jayel...@gmail.comwrote:
On Mar 16, 1:40 pm, "pooba53" <poob...@gmail.comwrote:
Posted this to vb.crystal and received no response.
---------------------------------------------------------------------------*-
I'm using VS 2003 and VB .NET along with the embedded version of
Crystal Reports. When I build and deploy my application, the Access db
that I use is stored in the directory containing the executable that
launches my program.
So that my application knows to find the access db in the same
directory as the executable when I ship the application, I use the
following in my connection string:
AppBase = AppDomain.CurrentDomain.BaseDirectory & "data.mdb"
Then I do this:
' Update our connection string
Me.OleDbConnection2.ConnectionString = "Jet OLEDB:Global
Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" &_
"ocking Mode=1;Data Source=" & AppBase & ";Jet OLEDB:Engine
Type=5;Provider=""Mic" & _
"rosoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet
OLEDB:SFP=False;persist sec" & _
"urity info=False;Extended Properties=;Mode=Share Deny
None;Jet OLEDB:Encrypt Dat" & _
"abase=False;Jet OLEDB:Create System Database=False;Jet
OLEDB:Don't Copy Locale o" & _
"n Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet" & _
" OLEDB:Global Bulk Transactions=1"
This works fine for my application...no problems.
However, I need to do the same for Crystal Reports so that it too
knows of the db location in a deployed application.
I cannot find in my code where the CR connection string is so I can
modify it in my code. How do I accomplish a modification of the CR db
connection string (at runtime?)?
Thanks a ton!
-Dan

http://www.codeproject.com/useritems/CrystalWin.asp
This does what you're looking for but it's in C#. Should be easy
enough to get it over to VB.NET. I've used it in my own code and it
works well.

Mar 17 '07 #3
Looks like this snippet from the Business Objects Web site did the
trick:

dbPath = AppDomain.CurrentDomain.BaseDirectory & "data.mdb"

Dim MyReport As New CrystalReport1
Dim CrTables As Tables
Dim CrTable As Table

CrTables = MyReport.Database.Tables

For Each CrTable In CrTables
CrTable.Location = dbPath
Next

Everything is now groovy.

Hope this helps someone...

On Mar 16, 2:40 pm, "pooba53" <poob...@gmail.comwrote:
Posted this to vb.crystal and received no response.
----------------------------------------------------------------------------
I'm using VS 2003 and VB .NET along with the embedded version of
Crystal Reports. When I build and deploy my application, the Access db
that I use is stored in the directory containing the executable that
launches my program.

So that my application knows to find the access db in the same
directory as the executable when I ship the application, I use the
following in my connection string:
AppBase = AppDomain.CurrentDomain.BaseDirectory & "data.mdb"

Then I do this:

' Update our connection string
Me.OleDbConnection2.ConnectionString = "Jet OLEDB:Global
Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=" & AppBase & ";Jet OLEDB:Engine
Type=5;Provider=""Mic" & _
"rosoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet
OLEDB:SFP=False;persist sec" & _
"urity info=False;Extended Properties=;Mode=Share Deny
None;Jet OLEDB:Encrypt Dat" & _
"abase=False;Jet OLEDB:Create System Database=False;Jet
OLEDB:Don't Copy Locale o" & _
"n Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet" & _
" OLEDB:Global Bulk Transactions=1"

This works fine for my application...no problems.

However, I need to do the same for Crystal Reports so that it too
knows of the db location in a deployed application.

I cannot find in my code where the CR connection string is so I can
modify it in my code. How do I accomplish a modification of the CR db
connection string (at runtime?)?

Thanks a ton!
-Dan

Mar 19 '07 #4
On Mar 18, 8:17 pm, "pooba53" <poob...@gmail.comwrote:
Looks like this snippet from the Business Objects Web site did the
trick:

dbPath = AppDomain.CurrentDomain.BaseDirectory & "data.mdb"

Dim MyReport As New CrystalReport1
Dim CrTables As Tables
Dim CrTable As Table

CrTables = MyReport.Database.Tables

For Each CrTable In CrTables
CrTable.Location = dbPath
Next

Everything is now groovy.

Hope this helps someone...

On Mar 16, 2:40 pm, "pooba53" <poob...@gmail.comwrote:
Posted this to vb.crystal and received no response.
---------------------------------------------------------------------------*-
I'm using VS 2003 and VB .NET along with the embedded version of
Crystal Reports. When I build and deploy my application, the Access db
that I use is stored in the directory containing the executable that
launches my program.
So that my application knows to find the access db in the same
directory as the executable when I ship the application, I use the
following in my connection string:
AppBase = AppDomain.CurrentDomain.BaseDirectory & "data.mdb"
Then I do this:
' Update our connection string
Me.OleDbConnection2.ConnectionString = "Jet OLEDB:Global
Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" &_
"ocking Mode=1;Data Source=" & AppBase & ";Jet OLEDB:Engine
Type=5;Provider=""Mic" & _
"rosoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet
OLEDB:SFP=False;persist sec" & _
"urity info=False;Extended Properties=;Mode=Share Deny
None;Jet OLEDB:Encrypt Dat" & _
"abase=False;Jet OLEDB:Create System Database=False;Jet
OLEDB:Don't Copy Locale o" & _
"n Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet" & _
" OLEDB:Global Bulk Transactions=1"
This works fine for my application...no problems.
However, I need to do the same for Crystal Reports so that it too
knows of the db location in a deployed application.
I cannot find in my code where the CR connection string is so I can
modify it in my code. How do I accomplish a modification of the CR db
connection string (at runtime?)?
Thanks a ton!
-Dan- Hide quoted text -

- Show quoted text -
Sorry. That c# code used the LogonInfo object for a SQL connection,
not an access one which you'd requested.

Mar 19 '07 #5

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

Similar topics

5
by: Mike | last post by:
I am writing a .NET application in C# that uses Crystal Reports. I want the crystal reports to grab information from a database no matter where the database is located. To do this, I want to...
0
by: Atif | last post by:
Hi All My problem is not related with this group BUT i have got a clue from here that's why i am posting this question over here. I am using Crystal Reports 9 with MySQL and SQL Server....
2
by: Naveen | last post by:
Hi All, I have developed an application in ASP.NET and everything went fine till i found a need to use Crystal Reports, after surfing I found that Crystal Reports can only be used when I have a...
7
by: Bernie Yaeger | last post by:
I can't believe that there aren't lots of developers who: 1. create a crystal report that connects to sql server 2. calls the report using the crystalreportviewer control to view it and then,...
7
by: Henry | last post by:
I am writing a Windows forms VB.Net/MS SQL application via VS 2003 that utilizes Crystal Reports. I want to be able to dynamically set the report data source at run time. I'm trying to change...
3
by: Marcos Beccar Varela | last post by:
Hello, does anyone knows how to make a SQL Server connection from a string not using the "wizard"? I have various reports and I need to make a connection that when the parameters are changed in...
0
by: bonita | last post by:
In my ASP.NET page, I have 2 checkboxes for users to choose which crystal report they want to display. These two reports use different tables. If report1 has been choosen and displayed in the...
2
by: Brad | last post by:
Where is the connection string stored for a simple Crystal Report Application. What I am trying to do is: 1. Create a simple report from a Firebird database using an ODBC connection 2. Need to...
0
by: Crash | last post by:
Hello everyone, I need help creating an asp page to view a crystal report, which requires that that I change the database connection dynamically. I thought I had this problem licked in CR7 (the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.