Showing posts with label mdb. Show all posts
Showing posts with label mdb. Show all posts

Friday, March 9, 2012

Password Required on Open of Linked Access mdb file

Any help would be great. I have an mdb file that is linked
to a table on my SQL Server which resides on a corporate
Web Server. I have a non-Windows Authenticated username
and password to the SQL Server database, so I have to
enter the password everytime I open the Access database
that links to the SQL Server. Is there anywhere to store
my password so that I can bypass having to enter it
everytime I open a linked mdb? Thanks!That information is stored in the tabledef properties of the linked
tables. One solution to this problem is to write code when the
application starts up. The code creates new tabledef objects,
supplying the user name and password (which you can collect from a
form). When the application shuts down, delete the tabledef objects.
This way security information persists only for the life of the
application instead of being permanently cached with the linked
tables.
--mary
On Mon, 3 May 2004 16:01:07 -0700, "mj"
<anonymous@.discussions.microsoft.com> wrote:

>Any help would be great. I have an mdb file that is linked
>to a table on my SQL Server which resides on a corporate
>Web Server. I have a non-Windows Authenticated username
>and password to the SQL Server database, so I have to
>enter the password everytime I open the Access database
>that links to the SQL Server. Is there anywhere to store
>my password so that I can bypass having to enter it
>everytime I open a linked mdb? Thanks!

Password Required on Open of Linked Access mdb file

Any help would be great. I have an mdb file that is linked
to a table on my SQL Server which resides on a corporate
Web Server. I have a non-Windows Authenticated username
and password to the SQL Server database, so I have to
enter the password everytime I open the Access database
that links to the SQL Server. Is there anywhere to store
my password so that I can bypass having to enter it
everytime I open a linked mdb? Thanks!
That information is stored in the tabledef properties of the linked
tables. One solution to this problem is to write code when the
application starts up. The code creates new tabledef objects,
supplying the user name and password (which you can collect from a
form). When the application shuts down, delete the tabledef objects.
This way security information persists only for the life of the
application instead of being permanently cached with the linked
tables.
--mary
On Mon, 3 May 2004 16:01:07 -0700, "mj"
<anonymous@.discussions.microsoft.com> wrote:

>Any help would be great. I have an mdb file that is linked
>to a table on my SQL Server which resides on a corporate
>Web Server. I have a non-Windows Authenticated username
>and password to the SQL Server database, so I have to
>enter the password everytime I open the Access database
>that links to the SQL Server. Is there anywhere to store
>my password so that I can bypass having to enter it
>everytime I open a linked mdb? Thanks!

Monday, February 20, 2012

Passing specific mdb files to Crystal 8

Hi Guys

I call a few reports from VB6 but always using the mdb file it was created with.

Now I have two mdb databases containing exactly the same fields but holding different data. How do I pass the filename that the report must use to the report? Sometimes I want the data that's in abc.mdb and sometimes the data that's in def.mdb. Maybe later there will be a ghi.mdb and jkl.mdb etc...

Any help greatly appreciated.

BezzieWhich tool or programming language you are using to do so ? Is it VB , .net or Java ?

Thanks|||Hi

I'm calling the Reports (Crystal Reports 8) from a Visual Basic 6 application.

Bezzie|||Hello Bezzie,

Let me reiterate what you are planning to do.

You have a report created in crystal 8.0 using abc.mdb. Now using VB application you want to switch the database at runtime in such a way that if you want to see data from def.mdb or ghi.mdb you need to be able to do that.

To achieve this goal what you need to do is

1. Create report using abc.mdb.
2. Write VB code to reset connection information at runtime.
3. Preview report.

We need to explore step 2 before that I would like to know are we on same page, so far so good ?

THanks|||Hi Dilemma

Yes. The program I'm working on is a genetic calculator for birds. I previously had only one mdb file that held all the info I needed on my reports.

I've started to add additional species to the program so changed my mdb so that I have a mdb with the userdata, and then one mdb for each species of bird.

The userdata.mdb will allways be in use throughout the program but there is a different mdb for each species of bird with the species specific data.

So when the user select to work with species ABC I need to pass the ABC.mdb with the data of species ABC and when he select species DEF I need to pass DEF.mdb etc. Those bird specific databases might become more and more as the species is added to the program so that's why I need to keep them separate, and why I don't want to create a separate report for each species of bird as the report will be exactly the same for each species but with a different set of data!

Bezzie|||You need to code something like this. Let me findout ODBC's example. Meanwhile I would like you to get familiar with this code.

How to connect to an OLEDB data source
This example demonstrates how to connect to an OLEDB (ADO) data source, change the data source, and change the database by using the ConnectionProperty Object, as well as how to change the table name by using the Location property of the DatabaseTable Object,. CrystalReport1 is created using an ODBC data source connected to the pubs database on Microsoft SQL Server. The report is based off the authors table.

' Create a new instance of the report.
Dim Report As New CrystalReport1

Private Sub Form_Load()
' Declare a ConnectionProperty object.
Dim CPProperty As CRAXDRT.ConnectionProperty
' Declare a DatabaseTable object.
Dim DBTable As CRAXDRT.DatabaseTable

' Get the first table in the report.
Set DBTable = Report.Database.Tables(1)

' Get the "Data Source" property from the
' ConnectionProperties collection.
Set CPProperty = DBTable.ConnectionProperties("Data Source")

' Set the new data source (server name).
' Note: You do not need to set this property if
' you are using the same data source.
CPProperty.Value = "Server2"

' Get the "User ID" property from the
' ConnectionProperties collection.
Set CPProperty = DBTable.ConnectionProperties("User ID")

' Set the user name.
' Note: You do not need to set this property if
' you are using the same user name.
CPProperty.Value = "UserName"

' Get the "Password" property from the
' ConnectionProperties collection.
Set CPProperty = DBTable.ConnectionProperties("Password")

' Set the password.
' Note: You must always set the password if one is
' required.
CPProperty.Value = "Password"

' Get the "Initial Catalog" (database name) property from the
' ConnectionProperties collection.
' Note: You do not need to set this property if
' you are using the same database.
Set CPProperty = DBTable.ConnectionProperties("Initial Catalog")

' Set the new database name.
CPProperty.Value = "master"

' Set the new table name.
DBTable.Location = "authors2"

Screen.MousePointer = vbHourglass
' Set the report source of the viewer and view the report.
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
Screen.MousePointer = vbDefault
End Sub

Thanks|||Hi Dilemma

Thanks for the trouble. I got it to work with Datafiles Property.

Bezzie|||Excellent Job.

Thanks
Dilemma