Showing posts with label files. Show all posts
Showing posts with label files. Show all posts

Friday, March 30, 2012

Peachtree to SQL Server

Has anyone ever imported peachtree dat files into SQL Server or know of
a way to do this?

Thanks!Todd S wrote:

Quote:

Originally Posted by

Has anyone ever imported peachtree dat files into SQL Server or know of
a way to do this?


Last time I had to pull data from Peachtree, it used DBF files for data
storage. (Other versions may use other file formats, I dunno.) There
are plenty of tools to pull data out of DBF files, either directly to
SQL, or to an intermediate text file.

Monday, March 26, 2012

PDF files with images get unexpectedly large in SQL Server 2000 Reporting Services

When using quite small JPEGS (~ 800 KB) in a report the exported PDF is a few megabytes of size. Am I missing something (e.g. some kind of compression)?

Can anyone give me a hint on this one?

Thanks,
Neno

There is a known bug in 2000 (which I know wasn't fixed in the SP2 beta -- don't know about SP2 RTM, though) in the PDF renderer -- It causes images of any type to be converted to bitmaps, then rendered. I bet this is what you're running into.

|||

i want to download some programme so i need urgent thanks

|||

I would suggest installing RS SP2 and the latest QFE available (KB912424).

Thank you,

Nico

|||This problem still occurs in SQL Reporting 2005 localreports. An issue has been opened for this problem. Please add your vote. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=232211

PDF files with images get unexpectedly large in SQL Server 2000 Reporting Services

When using quite small JPEGS (~ 800 KB) in a report the exported PDF is a few megabytes of size. Am I missing something (e.g. some kind of compression)?

Can anyone give me a hint on this one?

Thanks,
Neno

There is a known bug in 2000 (which I know wasn't fixed in the SP2 beta -- don't know about SP2 RTM, though) in the PDF renderer -- It causes images of any type to be converted to bitmaps, then rendered. I bet this is what you're running into.

|||

i want to download some programme so i need urgent thanks

|||

I would suggest installing RS SP2 and the latest QFE available (KB912424).

Thank you,

Nico

|||This problem still occurs in SQL Reporting 2005 localreports. An issue has been opened for this problem. Please add your vote. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=232211sql

PDF files with images get unexpectedly large in SQL Server 2000 Reporting Services

When using quite small JPEGS (~ 800 KB) in a report the exported PDF is a few megabytes of size. Am I missing something (e.g. some kind of compression)?

Can anyone give me a hint on this one?

Thanks,
Neno

There is a known bug in 2000 (which I know wasn't fixed in the SP2 beta -- don't know about SP2 RTM, though) in the PDF renderer -- It causes images of any type to be converted to bitmaps, then rendered. I bet this is what you're running into.

|||

i want to download some programme so i need urgent thanks

|||

I would suggest installing RS SP2 and the latest QFE available (KB912424).

Thank you,

Nico

|||This problem still occurs in SQL Reporting 2005 localreports. An issue has been opened for this problem. Please add your vote. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=232211

PDF files from SQL queries?

Hi,
Can anyone shed any light on how easy it is to generate PDF reports on the fly from SQL queries. I'd prefer not to use an intermediary report writer, like Crystal.

Presumably I'd need the full product of Adobe Acrobat writer?
How quickly can they be generated?

Any pointers regarding this greatly appreciated...

GregI've been using PHP to pass SQL queries and the FPDF class to generate the pdf files for output. I suppose this would count as using an intermediary report writer, but at least all the bits are free.

Ursus

Originally posted by gregclark
Hi,
Can anyone shed any light on how easy it is to generate PDF reports on the fly from SQL queries. I'd prefer not to use an intermediary report writer, like Crystal.

Presumably I'd need the full product of Adobe Acrobat writer?
How quickly can they be generated?

Any pointers regarding this greatly appreciated...

Greg|||Check out this article.

http://www.sqlservercentral.com/columnists/mivica/creatingapdffromastoredprocedure.asp|||Hi, thanks for the replies. I think i'm going to have to use an intermediate tool such as crystal to get what i want into PDF.

I see that Microsoft have just released Reporting Services for SQL server (http://www.microsoft.com/sql/reporting/default.asp), and there also appears to be a good summary of tools around at this posting (http://www.dbforums.com/showthread.php?threadid=706954),

I'm going to look into these - does anyone know of any other good tools to look at also?

Cheers
g.

PDF file

Can SSRS write reports in PDF files? What about multiple reports in a single PDF file? Thanks.Yes - PDF is an output type. You can create multiple reports and join them in one 'master' report as subreport objects to return them all in one file.|||Please kindly provide related tutorial links. Thanks.

Friday, March 23, 2012

PDF creation automation

hello

is it possible to generate PDF files from reports programmatically ?

Not quite sure what you mean

but you CAN export a report to PDF format, as well as subscribe to a report with PDF format (auto-sent to your e-mail, or to a network location)

|||

Hi,

yep you can do this. As the Reporting Services exposes a webservice interface you can call the Render() method on the Reporting Services.

See this sample: http://msdn2.microsoft.com/en-us/library/aa258532(SQL.80).aspx

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||Yes it is, although you might have to go to great lengths to accomplish it.

And if you do it enough, it might be worth your while to create a class to speed things along. We took this approach when trying to auto-export a report to a PDF file with our system.

The following code was adapted from Chris O'Connor's Channel9 blog (http://channel9.msdn.com/ShowPost.aspx?PostID=87032)

First off, we created a separate Reporting Service Exporter class to use from anywhere inside our enterprise system. This required adding a web reference, which we added to the Objects portion of our project. Import that namespace, and create the class:

Imports Objects.ReportingService

Public Class ReportingServiceExporter

#Region " Properties "

Public Property ReportPath() As String
Get
Return Me.m_sReportPath
End Get
Set(ByVal Value As String)
Me.m_sReportPath = Value
End Set
End Property

Public Property FilePath() As String
Get
Return Me.m_sFilePath
End Get
Set(ByVal Value As String)
Me.m_sFilePath = Value
End Set
End Property

#End Region

#Region " Constructors "

#End Region

#Region " Declarations "
'File types to export to
'HTML 3.2 and 4.0 were removed for simplicity's sake
Public Enum ReportExportFileType
XML
NULL
CSV
IMAGE
PDF
MHTML
EXCEL
HTMLOWC
End Enum

Private Params As New Hashtable
Private m_sReportPath As String = String.Empty
Private m_sFilePath As String = String.Empty

#End Region

#Region " Functions "

Private Function LoadParams() As ReportingService.ParameterValue()

Dim array(Params.Count - 1) As ReportingService.ParameterValue
Dim i As Integer = 0

'Since the Parameter array uses a key-value pair, use a DictionaryEntry to hold the necessary information to construct the parameter array
For Each de As DictionaryEntry In Params
Dim pValue As New ParameterValue
pValue.Name = de.Key.ToString()
pValue.Value = de.Value.ToString()
array(i) = pValue
i += 1
Next

Return array

End Function

Public Function ExportReport(ByVal outputFormat As ReportExportFileType) As Boolean
'Renders the report to the file type specified by outputFormat
'Requires the ReportPath() and FilePath() properties to be set prior to the function call

Dim objReportingService As ReportingService.ReportingService
Dim results As Byte()
Dim fs As System.IO.FileStream
Dim sOutputFormat As String = outputFormat.ToString()

'REQUIRED for method call - but not used
Dim DeviceInfo As String = Nothing
Dim HistoryId As String = Nothing
Dim ShowHideToggle As String = Nothing
Dim RSCredentials As DataSourceCredentials() = Nothing

'OUTPUT variables
Dim RSParamsUsed As ParameterValue()
Dim RSWarnings As Warning()
Dim Encoding As String
Dim MimeType As String
Dim StreamIds As String()



Try

objReportingService = New ReportingService.ReportingService
objReportingService.Url = "http://REPORTSERVER/reportserver/ReportService.asmx" 'This maps to the location of the ReportingServices Web Service; available (by default) in the reportserver folder on your Report Server
objReportingService.Timeout = 600000 'Report will run up to ten minutes before timing out
objReportingService.Credentials = System.Net.CredentialCache.DefaultCredentials

'Renders the report to the results byte array
results = objReportingService.Render(m_sReportPath, sOutputFormat, HistoryId, DeviceInfo, LoadParams(), _
RSCredentials, ShowHideToggle, Encoding, MimeType, RSParamsUsed, RSWarnings, StreamIds)

'Delete any existing file with the same file name
System.IO.File.Delete(m_sFilePath)

'Write to the specified file
fs = System.IO.File.OpenWrite(m_sFilePath)
fs.Write(results, 0, results.Length)
fs.Close()

objReportingService.Dispose()
objReportingService = Nothing
'GC.Collect()

Return True

Catch ex As Exception
DisplayError(ex)
MsgBox("Report Export Failed")
Return False

Finally
objReportingService = Nothing
results = Nothing
fs = Nothing
'GC.Collect()
End Try
End Function

Public Sub AddParameter(ByVal name As String, ByVal value As Object)
Params.Add(name, value)
End Sub

#End Region

End Class

Next, from wherever the event that triggers the export is located, you need to create the Exporter object and set it's parameters, then call the ExportReport function to render the report:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e as System.EventArgs) Handles Button1.Click
Dim exportSucceeded As Boolean

'Prepare the report for exporting
'The ReportingServiceExporter FilePath and ReportPath properties MUST be set before exporting
Dim exporter as New ReportingServiceExporter

'Target output file path - change the extension to whatever format you need to export to
exporter.FilePath = "C:\temp\report.pdf"

'Path to the report on the server, starting from //REPORTSERVER/reportserver, where the web reference inside the ReportingServiceExporter is loaded from; make sure you don't type the .rdl extension
exporter.ReportPath = "/Reporting Services/ReportName"

'Next, simply add the parameters that the report requires
exporter.AddParameter("Param1", value)
exporter.AddParameter("Param2", value)
exporter.AddParameter("Param3", value)

'Finally, call the ExportReport method with the enumerated type of the format
exportSucceeded = exporter.ExportReport(ReportingServiceExporter.ReportExportFileType.PDF)

That's pretty much all there is to it. Hope this helps.
|||thanks for your suggestions.

the idea is replacing an existing solution which creates PDF files from Business Objects automatically.
The datasource contains information for different individuals, and the automatic PDF creation process creates one file per individual.

PDF creation automation

hello

is it possible to generate PDF files from reports programmatically ?

Not quite sure what you mean

but you CAN export a report to PDF format, as well as subscribe to a report with PDF format (auto-sent to your e-mail, or to a network location)

|||

Hi,

yep you can do this. As the Reporting Services exposes a webservice interface you can call the Render() method on the Reporting Services.

See this sample: http://msdn2.microsoft.com/en-us/library/aa258532(SQL.80).aspx

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||Yes it is, although you might have to go to great lengths to accomplish it.

And if you do it enough, it might be worth your while to create a class to speed things along. We took this approach when trying to auto-export a report to a PDF file with our system.

The following code was adapted from Chris O'Connor's Channel9 blog (http://channel9.msdn.com/ShowPost.aspx?PostID=87032)

First off, we created a separate Reporting Service Exporter class to use from anywhere inside our enterprise system. This required adding a web reference, which we added to the Objects portion of our project. Import that namespace, and create the class:

Imports Objects.ReportingService

Public Class ReportingServiceExporter

#Region " Properties "

Public Property ReportPath() As String
Get
Return Me.m_sReportPath
End Get
Set(ByVal Value As String)
Me.m_sReportPath = Value
End Set
End Property

Public Property FilePath() As String
Get
Return Me.m_sFilePath
End Get
Set(ByVal Value As String)
Me.m_sFilePath = Value
End Set
End Property

#End Region

#Region " Constructors "

#End Region

#Region " Declarations "
'File types to export to
'HTML 3.2 and 4.0 were removed for simplicity's sake
Public Enum ReportExportFileType
XML
NULL
CSV
IMAGE
PDF
MHTML
EXCEL
HTMLOWC
End Enum

Private Params As New Hashtable
Private m_sReportPath As String = String.Empty
Private m_sFilePath As String = String.Empty

#End Region

#Region " Functions "

Private Function LoadParams() As ReportingService.ParameterValue()

Dim array(Params.Count - 1) As ReportingService.ParameterValue
Dim i As Integer = 0

'Since the Parameter array uses a key-value pair, use a DictionaryEntry to hold the necessary information to construct the parameter array
For Each de As DictionaryEntry In Params
Dim pValue As New ParameterValue
pValue.Name = de.Key.ToString()
pValue.Value = de.Value.ToString()
array(i) = pValue
i += 1
Next

Return array

End Function

Public Function ExportReport(ByVal outputFormat As ReportExportFileType) As Boolean
'Renders the report to the file type specified by outputFormat
'Requires the ReportPath() and FilePath() properties to be set prior to the function call

Dim objReportingService As ReportingService.ReportingService
Dim results As Byte()
Dim fs As System.IO.FileStream
Dim sOutputFormat As String = outputFormat.ToString()

'REQUIRED for method call - but not used
Dim DeviceInfo As String = Nothing
Dim HistoryId As String = Nothing
Dim ShowHideToggle As String = Nothing
Dim RSCredentials As DataSourceCredentials() = Nothing

'OUTPUT variables
Dim RSParamsUsed As ParameterValue()
Dim RSWarnings As Warning()
Dim Encoding As String
Dim MimeType As String
Dim StreamIds As String()



Try

objReportingService = New ReportingService.ReportingService
objReportingService.Url = "http://REPORTSERVER/reportserver/ReportService.asmx" 'This maps to the location of the ReportingServices Web Service; available (by default) in the reportserver folder on your Report Server
objReportingService.Timeout = 600000 'Report will run up to ten minutes before timing out
objReportingService.Credentials = System.Net.CredentialCache.DefaultCredentials

'Renders the report to the results byte array
results = objReportingService.Render(m_sReportPath, sOutputFormat, HistoryId, DeviceInfo, LoadParams(), _
RSCredentials, ShowHideToggle, Encoding, MimeType, RSParamsUsed, RSWarnings, StreamIds)

'Delete any existing file with the same file name
System.IO.File.Delete(m_sFilePath)

'Write to the specified file
fs = System.IO.File.OpenWrite(m_sFilePath)
fs.Write(results, 0, results.Length)
fs.Close()

objReportingService.Dispose()
objReportingService = Nothing
'GC.Collect()

Return True

Catch ex As Exception
DisplayError(ex)
MsgBox("Report Export Failed")
Return False

Finally
objReportingService = Nothing
results = Nothing
fs = Nothing
'GC.Collect()
End Try
End Function

Public Sub AddParameter(ByVal name As String, ByVal value As Object)
Params.Add(name, value)
End Sub

#End Region

End Class

Next, from wherever the event that triggers the export is located, you need to create the Exporter object and set it's parameters, then call the ExportReport function to render the report:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e as System.EventArgs) Handles Button1.Click
Dim exportSucceeded As Boolean

'Prepare the report for exporting
'The ReportingServiceExporter FilePath and ReportPath properties MUST be set before exporting
Dim exporter as New ReportingServiceExporter

'Target output file path - change the extension to whatever format you need to export to
exporter.FilePath = "C:\temp\report.pdf"

'Path to the report on the server, starting from //REPORTSERVER/reportserver, where the web reference inside the ReportingServiceExporter is loaded from; make sure you don't type the .rdl extension
exporter.ReportPath = "/Reporting Services/ReportName"

'Next, simply add the parameters that the report requires
exporter.AddParameter("Param1", value)
exporter.AddParameter("Param2", value)
exporter.AddParameter("Param3", value)

'Finally, call the ExportReport method with the enumerated type of the format
exportSucceeded = exporter.ExportReport(ReportingServiceExporter.ReportExportFileType.PDF)

That's pretty much all there is to it. Hope this helps.
|||thanks for your suggestions.

the idea is replacing an existing solution which creates PDF files from Business Objects automatically.
The datasource contains information for different individuals, and the automatic PDF creation process creates one file per individual.

Tuesday, March 20, 2012

Path to configuration files

Can someone tell me why path to the configuration file couldn't be relative to the package? When I try to use relative path (i.e. do not specify full path to the configuration file) package then run from BIDS looks for configuration file in the solution folder instead of package's folder (project folder).

Is there ane way to force package use same folder to search for caonfiguration files?

Thanks

No unfortunately not. Maybe this is something you could request at http://connect.microsoft.com/sqlserver/feedback

I don't know the rationale for not allowing relative paths but I would guess its because how would you know what the path relative to a package is if the package is stored in SQL Server? If you look at it from this perspective absolute paths make more sense.

-Jamie

|||

Ok. I'll try to live with it now=/

It seems very srange to me why no one at MSFT even think about of deployment process of ETL solutions to end-user's environment

|||

So, by the way, may be you know where package will search for configuration files if package stored in "program files\my company\my solution" folder and exeuted by dtexec in the way like this:

dtexec /file:"program files\my company\my solution\mypackage.dtsx"?

|||

Andrey Makarov wrote:

Ok. I'll try to live with it now=/

It seems very srange to me why no one at MSFT even think about of deployment process of ETL solutions to end-user's environment

Well, they did think about it. They just got it wrong that's all :) That is to say, there is a bug.

-Jamie

|||

Andrey Makarov wrote:

So, by the way, may be you know where package will search for configuration files if package stored in "program files\my company\my solution" folder and exeuted by dtexec in the way like this:

dtexec /file:"program files\my company\my solution\mypackage.dtsx"?

No. Perhaps you can tell me?

-Jamie

Path Setting for SQL 2005

I used SQL 2000 before. There are options for setting program files path and data path, which I usually install programs on C: and then data files in D: for easier maintenance. However, I cannot find this options in SQL 2005. Is that both (program files and data) must be locate in the same drive/path? or how can I do it same as SQL 2000? Please advise. Many thanks.

During installation time you are able to point certain directories to other paths than the default system path. Although some thing have to be installed on the system path, most of the Sql server parts can be put in different locations on the computer.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Thanks for your reply.

Sure I can find to change the installation path.

However, there are 2 path setting for SQL2000, one for Program Files and another for Data Files. But I only find one in SQL 2005. Does it mean the program files and data files must be in the same location in SQL2005? or else how can I install the Program Files on c: and then Data Files on D: in SQL2005?

Thank you very much for your help.

Maurice

Monday, March 12, 2012

Passwords in the SSIS configuration file

Thanks to some earlier help from this forum, I have my package running using configuration files and Windows Authentication. However, when I try to execute the package using Sql authentication, login fails for the user i am specifying. When I check out the configuration file, the connection string does not contain the password. I added the password to the connection string, but it does not cone back. I followed the instructions found on the following site:

http://www.nigelrivett.net/DTS/SSISConfigurationFile.html

After trying what was suggested there, I was still unsuccessful with my login attempt.

Anyone know how to set up a package to run using Sql authentication?

Thanks!

Craig

At the time of development, set the protection level of package to EncryptSensitiveWithUserKey, after this sertting the package will store the sensitive information like password in itself.

Atul

Friday, March 9, 2012

Password protected BAK Files

Hello All,
Can anyone help me? I would like to put a password on BAK files everytime my
backup jobs run. So that when I restore a db from one of these BAK files, I
need to provide the password.
Thanks in Advance,
Tuoc"Tuoc" <anonymous@.discussions.microsoft.com> wrote in message
news:D9549303-3521-4C75-ABFB-685820FC140D@.microsoft.com...
quote:

> Can anyone help me? I would like to put a password on BAK files everytime

my backup jobs run. So that when I restore a db from one of these BAK files,
I need to provide the password.
quote:

>

If you are looking to secure your BAK files, consider using EFS (Encrypted
File System) for the folder that you dump your BAK files. Even if you could
make this work, file level passwords would not be of any value.
Steve|||SQL2000 only
BACKUP DATABASE pubs to DISK = 'c:\pubs.bak'
WITH PASSWORD = 'test'
If you try and restore this without a password, you get
RESTORE DATABASE pubs FROM DISK = 'c:\pubs.bak'
WITH REPLACE
Server: Msg 3279, Level 16, State 2, Line 1
Access is denied due to a password failure
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
To restore, you need the password e.g.
RESTORE DATABASE pubs FROM DISK = 'c:\pubs.bak'
WITH REPLACE,PASSWORD = 'test'
However, I've never really seen anyone use this. There's also the issue of
managing/generating/storing the passwords so they're not just hardcoded into
the jobs but using something like NEWID would probably do it but you would
have to store it with the backup filename somewhere so you could restore it
e.g.
declare @.p varchar(36) ; set @.p = NEWID()
declare @.file varchar(200) ; set @.file = '<generate filename>'
-- store password away somewhere secure with filename
BACKUP DATABASE pubs to DISK = @.file
WITH PASSWORD = @.p
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Tuoc" <anonymous@.discussions.microsoft.com> wrote in message
news:D9549303-3521-4C75-ABFB-685820FC140D@.microsoft.com...
quote:

> Hello All,
> Can anyone help me? I would like to put a password on BAK files everytime

my backup jobs run. So that when I restore a db from one of these BAK files,
I need to provide the password.
quote:

> Thanks in Advance,
> Tuoc
|||Tuoc
You also posted this on .server where there are quite a few reponses. Please
do not post the same questions on multiple newsgroups independently, so you
will not have to follow multiple threads of response, and so other people
won't waste time answering a question that has already been answered.
Thanks!
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Tuoc" <anonymous@.discussions.microsoft.com> wrote in message
news:D9549303-3521-4C75-ABFB-685820FC140D@.microsoft.com...
quote:

> Hello All,
> Can anyone help me? I would like to put a password on BAK files everytime

my backup jobs run. So that when I restore a db from one of these BAK files,
I need to provide the password.
quote:

> Thanks in Advance,
> Tuoc
|||Kalen,
I'm sorry about that.
Tuoc

Wednesday, March 7, 2012

Password in config file

Hi

Config files doesn't seem to work for me :( i want to make a common config file for all of my packages but it is giving me error

Validation error. The AcquireConnection method call to the connection manager failed with error code 0xC0202009

I have placed pasword in my config file too. Following is config file which i m using, server name n password are masked.

<?xml version="1.0"?>
<DTSConfiguration>
<DTSConfigurationHeading>
<DTSConfigurationFileInfo GeneratedBy="SSBKD\955688" GeneratedFromPackageName="DTS_ACPM_MarkIT_Indices_Composites_TRAC_X_Asia_Index" GeneratedFromPackageID="{CB3660A1-5E6C-4D08-A7F5-4D6CE83578E2}" GeneratedDate="2006/10/19 14:05:20"/>
</DTSConfigurationHeading>
<Configuration ConfiguredType="Property" Path="\Package.Connections[ssmgn838.ACPM.acpmuser].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>server=########;user id=sa;password=******;database=ACPM;
</ConfiguredValue>
</Configuration>
<Configuration ConfiguredType="Property" Path="\Package.Connections[Text File (Source)].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>C:\acpm\filetoupload\Copy of ACPM_MarkIT_Indices_Constituents_Composites_1_ITRAXX_ASIA.tab
</ConfiguredValue>
</Configuration>
</DTSConfiguration>

If you take the ConnectionString from the configuration file and use it does the AcquiredConnection works?

The failure happens when you using DTExec or from designer?

Thanks,
Ovidiu

|||

problem came in AcquiredConnection

DTexec throws this error

even in designer it doesnt't identify password, i have to give it manually in my connection object.

|||

Can you tell me what type of connection is this? Oledb ADO.net?

Also can you check what is the value for the Package property ProtectionLevel?


Thanks,
Ovidiu

Password for replication

I have a server that I will need to uninstall SQL Server and then install it again because of missing files.

I need to bring the back to the way it is or was. My problem is replication.
Since I am new one knows the Administrative Link password. When I try to generate script for replication for the password it uses the 'N'.

Is there a way to work around this problem? Please advise.

Thanks

LystraCan't you go into the distributor properties and set a new password?

-PatP|||But wouldn't I need to change it at 2 places?

If I do change it will it interupt anything?

Lystra|||If you are going to trash your existing server, you'll interrupt things a bit in the process. :) Changing the password will have little additional affect.

I'd take a systemic approach to your problem:

1) Declare downtime
2) Script, then remove replication completely
3) Detach all of the databases from the affected server
4) Rebuild the affected server
5) Reattach the databases to the affected server
6) Recreate replication from the script (this will reset the password to an empty string)
7) Collapse in a heap for about 16 hours or so

-PatP

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