Hi
You don't need to start with a database when restoring. Click on the
database leaf in the tree and then enter your own database name in the
database name box, then go on and choose the file to restore from using the
restore from device option.
If you know that there is only one backup in the file and the database
doesn't exist you could use something like the following from a query window
if you change the file path/name and database name:
RESTORE DATABASE NewDatabase
FROM DISK = 'D:\Backups\DBBACKUP.bak'
GO
John
"GM" <guidomarche@.libero.it_n0sp4m> wrote in message
news:XbvAj.10735$q53.6897@.tornado.fastwebnet.it...
> Hi, i have a problem:
> I have a .bak file from a database backup, but i don't have the database
> anymore.
> How can i create the database from the backup file?
> If i try to restore the database with management studio, i should already
> have a database to put the data in.. but i don't have it anymore.
>
> If i create a new database, and try to put the backed up data into it, i
> got
> an error:
> Msg 3154, Level 16, State 4, Line 1
> The backup set holds a backup of a database other than the existing 'XXX'
> database.
>
> Is there a way to re-create the database from the backup?(it's a full
> backup)
> I'm working with MSSQL Server 2005 and Management Studio.
> Thank you for any advice!
>
>
"GM" <guidomarche@.libero.it_n0sp4m> wrote in message
news:7VxAj.10913$q53.947@.tornado.fastwebnet.it...
> Hi, thank you for the answer!
> the .bak file contains only one backup
> If i use the restore option, and type a new database name, when i execute
> i get te following error:
> Msg 5133, Level 16, State 1, Line 1
> Directory lookup for the file "D:\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\XXX_Data.mdf" failed with the operating system
> error 3(The system cannot find the path specified.).
>
> I've already tryed
> RESTORE DATABASE NewDatabase
> FROM DISK = 'D:\Backups\DBBACKUP.bak'
> (with the right location/dbname)
> but if the database does not exists, i got an error:
> Msg 5133, Level 16, State 1, Line 1
> Directory lookup for the file "D:\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\XXX_Data.mdf" failed with the operating system
> error 3(The system cannot find the path specified.).
> Msg 3156, Level 16, State 3, Line 1
> File 'XXX_Data' cannot be restored to 'D:\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\XXX_Data.mdf'. Use WITH MOVE to identify a valid
> location for the file.
> Msg 5133, Level 16, State 1, Line 1
> Directory lookup for the file "D:\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\XXX_Log.ldf" failed with the operating system
> error 3(The system cannot find the path specified.).
> Msg 3156, Level 16, State 3, Line 1
> File 'XXX_Log' cannot be restored to 'D:\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\XXX_Log.ldf'. Use WITH MOVE to identify a valid
> location for the file.
> Msg 3119, Level 16, State 1, Line 1
> I've tryed to use "WITH MOVE " tu point to another folder, but since i
> don't have the mdf file, it's pointless...
>
Umm, that's not pointless at all. That's the exact whay you do this.
RESTORE DATABASE NewDatabase
from disk='D:\Backups\DBBACKUP.bak'
with move 'XXX_Data' to 'C:\newlocation_fordata\XXX_LOG.MDF',
move 'XXX_log' to 'C:\newlocation_forlogs\XXX_LOG.LDF'
> If i create a new database with the same name of the database i want to
> restor,e before trying to restore, i got the error i reported in the
> previous post..
|||RESTORE DATABASE [NewDatabaseName]
FROM DISK='BackupNameAndPath'
WITH MOVE 'OldDatabaseName' TO 'NewDatabaseNameAndPath.mdf',
MOVE 'OldDatabaseName_log' TO 'NewDatabaseNameAndPath.ldf'
NB the MOVEd strings are the logical database names. Use
RESTORE HEADERONLY FROM DISK = 'BackupNameAndPath'
to get a listing of the contents of the backup file to determine the
old database name.
sql
Showing posts with label own. Show all posts
Showing posts with label own. Show all posts
Sunday, March 25, 2012
Monday, March 19, 2012
CR11 - How do I choose a NULL value (or ALL RECORDS) in a dynamic parameter?
We are using CR11 and our own OLE DB provider that, in turn, uses our SQL Server database.
We are creating dynamic parameters that allow the user to pick from all the distinct values that a field can have. All but NULL, and we need to allow the user to pick NULL if there's any in the data.
In reality, we just need to find a way to let the user pick ALL values. However, if we create a dynamic parameter that doesn't accept multiple values, the user is forced to pick one of the available values or, if he doesn't, then CR will say the value is not valid when you hit OK to the parameter selections. If instead we create a parameter that accepts multiple values instead, the user has the option to pick all the available values, which at first seems to solve the problem, but these wouldn't include NULLs and those records would be filtered out in the results.
Thank you in advance.Anybody?|||You can try using two separate parameters in your Crystal Report (http://www.shelko.com). One can be a choice between all or specific and the second could be your list of specifics. Then base your selection criteria on the combination of these two parameters.
We are creating dynamic parameters that allow the user to pick from all the distinct values that a field can have. All but NULL, and we need to allow the user to pick NULL if there's any in the data.
In reality, we just need to find a way to let the user pick ALL values. However, if we create a dynamic parameter that doesn't accept multiple values, the user is forced to pick one of the available values or, if he doesn't, then CR will say the value is not valid when you hit OK to the parameter selections. If instead we create a parameter that accepts multiple values instead, the user has the option to pick all the available values, which at first seems to solve the problem, but these wouldn't include NULLs and those records would be filtered out in the results.
Thank you in advance.Anybody?|||You can try using two separate parameters in your Crystal Report (http://www.shelko.com). One can be a choice between all or specific and the second could be your list of specifics. Then base your selection criteria on the combination of these two parameters.
Sunday, March 11, 2012
CR10 RDC Default Printer Issue
Hi All,
I'm glad to have found this forum! I've slogged thru Crystal issues on my own for quite a while now and it's a relief to have a place to go to share information. I have a few questions today, so please bare with me.
I'm converting an ASP application from CR8 to CR10 CE Embedded. For the most part I'm using RAS to display and print reports. I have a couple of reports where the users send the reports directly to the printer without viewing them first.
First question, is there a way of sending a report directly to the printer and not the viewer in RAS? I haven't come across one and it looks like I'll have to use RDC for those reports.
I'm experimenting with RDC in ASP and I'm having an issue with the default printer.
Second question, how do you set the printer using RDC? I'm using the following code:
Set session ("oApp") = Server.CreateObject("CrystalRuntime.Application.10")
Set session("oRpt") = session("oApp").OpenReport(application("RASReportPath") + "XYTDailySchedule_test.rpt")
session("oRpt").SelectPrinter "winspool.drv", "DuplicationLaserJet", "P3_10.1.2.200"
session("oRpt").PrintOut false
The report keeps printing to the default printer, no matter what I'm setting it to programmatically. I thought maybe it had to do with the printer selected in the Report Designer, so I set that to "No Printer", and that didn't help.
I popped the oRpt object into the debug watch window and observed that the SelectPrinter method did not change the properties in oRpt. Hmmmm! Not sure what is going on there.
Third question, is there a good resource somewhere for learning the RDC and RAS object models? I can see the properties in a debug window, but I have not found good documentation on the methods. I have found that Business Objects has not improved the product documentation since they took over. It would really be nice to find a clear, concise reference of the object models.
Thanks!
LindaSecond question, how do you set the printer using RDC? I'm using the following code:
Set session ("oApp") = Server.CreateObject("CrystalRuntime.Application.10")
Set session("oRpt") = session("oApp").OpenReport(application("RASReportPath") + "XYTDailySchedule_test.rpt")
session("oRpt").SelectPrinter "winspool.drv", "DuplicationLaserJet", "P3_10.1.2.200"
session("oRpt").PrintOut false
I was able to figure this out on my own and am posting the solution in case somebody else is in the same boat. I had an error in the DeviceName and Port parameters. SelectPrinter must do validation before applying the parameters supplied. If the parameters are incorrect SelectPrinter does not change the printer settings. Perhaps there is a property in the RDC to trigger an error if this happens.........it certainly would have been useful to me!
I would still like to hear if anyone knows how to send a report directly to the printer using RAS, or if anyone has come across some good documentation of the RAS and RDC API's.
Thanks!
Linda|||First question, is there a way of sending a report directly to the printer and not the viewer in RAS? I haven't come across one and it looks like I'll have to use RDC for those reports.
VICTORY!!!! Just for the record, I was told months ago by Business Objects that this was impossible. I came across a white paper today, on the Business Objects site, that discusses RAS Server-Server Side printing, and gives you the code sample as well. Here it is:
http://www.buisnessobjects.com/global/pdf/dev_zone/ras_serverside_printing.pdf?ref=devzone_netzone_archive
Linda
I'm glad to have found this forum! I've slogged thru Crystal issues on my own for quite a while now and it's a relief to have a place to go to share information. I have a few questions today, so please bare with me.
I'm converting an ASP application from CR8 to CR10 CE Embedded. For the most part I'm using RAS to display and print reports. I have a couple of reports where the users send the reports directly to the printer without viewing them first.
First question, is there a way of sending a report directly to the printer and not the viewer in RAS? I haven't come across one and it looks like I'll have to use RDC for those reports.
I'm experimenting with RDC in ASP and I'm having an issue with the default printer.
Second question, how do you set the printer using RDC? I'm using the following code:
Set session ("oApp") = Server.CreateObject("CrystalRuntime.Application.10")
Set session("oRpt") = session("oApp").OpenReport(application("RASReportPath") + "XYTDailySchedule_test.rpt")
session("oRpt").SelectPrinter "winspool.drv", "DuplicationLaserJet", "P3_10.1.2.200"
session("oRpt").PrintOut false
The report keeps printing to the default printer, no matter what I'm setting it to programmatically. I thought maybe it had to do with the printer selected in the Report Designer, so I set that to "No Printer", and that didn't help.
I popped the oRpt object into the debug watch window and observed that the SelectPrinter method did not change the properties in oRpt. Hmmmm! Not sure what is going on there.
Third question, is there a good resource somewhere for learning the RDC and RAS object models? I can see the properties in a debug window, but I have not found good documentation on the methods. I have found that Business Objects has not improved the product documentation since they took over. It would really be nice to find a clear, concise reference of the object models.
Thanks!
LindaSecond question, how do you set the printer using RDC? I'm using the following code:
Set session ("oApp") = Server.CreateObject("CrystalRuntime.Application.10")
Set session("oRpt") = session("oApp").OpenReport(application("RASReportPath") + "XYTDailySchedule_test.rpt")
session("oRpt").SelectPrinter "winspool.drv", "DuplicationLaserJet", "P3_10.1.2.200"
session("oRpt").PrintOut false
I was able to figure this out on my own and am posting the solution in case somebody else is in the same boat. I had an error in the DeviceName and Port parameters. SelectPrinter must do validation before applying the parameters supplied. If the parameters are incorrect SelectPrinter does not change the printer settings. Perhaps there is a property in the RDC to trigger an error if this happens.........it certainly would have been useful to me!
I would still like to hear if anyone knows how to send a report directly to the printer using RAS, or if anyone has come across some good documentation of the RAS and RDC API's.
Thanks!
Linda|||First question, is there a way of sending a report directly to the printer and not the viewer in RAS? I haven't come across one and it looks like I'll have to use RDC for those reports.
VICTORY!!!! Just for the record, I was told months ago by Business Objects that this was impossible. I came across a white paper today, on the Business Objects site, that discusses RAS Server-Server Side printing, and gives you the code sample as well. Here it is:
http://www.buisnessobjects.com/global/pdf/dev_zone/ras_serverside_printing.pdf?ref=devzone_netzone_archive
Linda
Subscribe to:
Posts (Atom)