Wednesday, March 28, 2012
new to crystal reports xi to use with vb6
can someone just give me what dll should i use and if posible some example
i enclose the dll from some source code and the ones i try to use with no success thanks for help
ramon@.soler.com
report creation example
Object={3C62B3DD-12BE-4941-A787-EA25415DCD27}#10.0#0; crviewer.dll
Reference=*\G{23325710-7003-45DC-9B12-49FF312E9F1F}#a.0#0#..\..\..\..\Program Files\Common Files\Crystal Decisions\2.5\bin\craxddrt.dll#Crystal Reports ActiveX Designer Design and Runtime Library 10.0
Reference=*\G{00000200-0000-0010-8000-00AA006D2EA4}#2.0#0#..\..\..\..\Program Files\Common Files\system\ado\msado20.tlb#Microsoft ActiveX Data Objects 2.0 Library
Reference=*\G{405C5540-54BA-4352-8F27-8663CA6D6630}#1.0#0#..\..\..\..\Program Files\Common Files\Crystal Decisions\2.5\bin\crystalwizard.dll#Crystal Reports 10 Standard Wizard library
Reference=*\G{DBF72987-0B52-4F0B-A456-4CAE876EE792}#a.0#0#..\..\..\..\Program Files\Common Files\Crystal Decisions\2.5\bin\CRDesignerCtrl.DLL#Embeddable Crystal Reports Designer Control Library 10.0
Object={DBF72987-0B52-4F0B-A456-4CAE876EE792}#10.0#0; CRDesignerCtrl.DLL
simple viewer example
Reference=*\G{00000300-0000-0010-8000-00AA006D2EA4}#2.0#0#..\..\..\Program Files\Common Files\system\ado\msador15.dll#Microsoft ActiveX Data Objects Recordset 1.5 Library
Object={3C62B3DD-12BE-4941-A787-EA25415DCD27}#10.0#0; CRViewer.dll
Reference=*\G{76691052-244D-4C07-8ECA-9FA4F1A25263}#a.0#0#..\..\..\Program Files\Common Files\Crystal Decisions\2.5\bin\craxdrt.dll#Crystal Reports ActiveX Designer Run Time Library 10.0
added to try to view this examples but do not work
Reference=*\G{FB992564-9055-42B5-B433-FEA84CEA93C4}#b.0#0#..\CRViewer.dll#Crystal ActiveX Report Viewer Library 11.0
Reference=*\G{418F8E14-9E24-4057-A167-82A54E9B695B}#1.0#0#C:\Archivos de programa\Archivos comunes\Business Objects\3.0\bin\Cdo32.dll#Crystal Data Object Library 2.7
Reference=*\G{EFA3761F-4265-4464-A2DE-519B8E7E34ED}#b.0#0#C:\Archivos de programa\Archivos comunes\Business Objects\3.0\bin\craxdrt.dll#Crystal Reports ActiveX Designer Run Time Library 11.0
Reference=*\G{2A75196C-D9EB-4129-B803-931327F72D5C}#2.8#0#C:\Archivos de programa\Archivos comunes\System\ADO\msado15.dll#Microsoft ActiveX Data Objects 2.8 Library
Reference=*\G{52A44D15-DEEF-498D-945F-3F50102E042A}#1.0#0#C:\Archivos de programa\Business Objects\BusinessObjects Enterprise 11\win32_x86\plugins\desktop\CrystalEnterprise.LicenseKey\LicenseKey.dll#Crystal Enterprise LicenseKey PlugIn 11.0
Reference=*\G{BD2383E5-593B-47CC-854B-1E227C0DDA33}#1.0#0#C:\Archivos de programa\Business Objects\BusinessObjects Enterprise 11\win32_x86\plugins\desktop\CrystalEnterprise.Program\Program.dll#Crystal Enterprise Program PlugIn 11.0
Object={00025600-0000-0000-C000-000000000046}#4.6#0; crystl32.ocx
i have crystal reports xiSee if you are able to find solution here
www.businessobjects.com
Friday, March 9, 2012
New Log or append?
I'm backing into the DBA position from being an app / web designer. Using SQL 2005 and hating wizards, I'm trying to code a BACKUP LOG query to run every 15 minutes and create a separate date-time-stamped TRN. I have several questions starting with - should I be doing this? Is it better to create separate LOGs or append to one? Isn't it true that the only time I'll need the LOGs is when I have a crash and that then I'll need to RESTORE in date-time-order?
I'm doing a FULL backup every 6 hours and intend on automating deleting the TRNs on a successful completion of the BAK.
The following code runs fine and creates a date-time-stamped TRN but doesn't do what I want, as it overwrites the first TRN, so how do I create, say, four JOBSTEPs and get a JOBSTEP @.COMMAND to run the SETs?
USE msdb
IFEXISTS(SELECTNameFROM sysjobs WHEREName='jobDBBackupWedb_1Log')
EXECsp_delete_job @.job_name ='jobDBBackupWedb_1Log'
GO
DECLARE @.now char(14)-- current date in the form of yyyymmddhhmmss
DECLARE @.dbName sysname-- database name to include date-time-stamp
DECLARE @.Cmd nvarchar(260)-- variable used to build JobStep command
SET @.now =REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR(50),GETDATE(), 120),'-',''),' ',''),':','')
SET @.dbName ='Wedb_1_'+ @.now +'_.trn'
SET @.Cmd ='BACKUP LOG Wedb_1 TO DISK = '+CHAR(39)+'\\SERVER1\D$\SQLDatabases\Backup\WebEoc\'+ @.dbName +CHAR(39)
EXECsp_add_job
@.Job_Name ='jobDBBackupWedb_1Log',
@.Description ='Run Wedb_1 DB Backup Transaction Log Every 15 Minutes',
@.Category_Name ='Database Maintenance'
EXECsp_add_jobstep
@.Job_Name ='jobDBBackupWedb_1Log',
@.step_name ='DB_Backup_Log',
@.step_id = 1,
@.Database_Name ='Master',
@.subsystem ='TSQL',
@.command = @.Cmd
/*
Start time for the Transaction Log backups is seven and one half minutes after midnight
to not conflict with the Full database backups run every 6 hours starting at midnight.
The Transaction Log backups are to be run every fifteen minutes.
*/
EXECsp_Add_JobSchedule
@.Job_Name ='jobDBBackupWedb_1Log',
@.Name ='schedDB_BackupLog',
@.Freq_Type = 4,-- Daily
@.Freq_Interval = 1,-- Each day
@.Freq_Subday_Type = 0x4,-- Interval in minutes
@.Freq_Subday_Interval = 15,-- Every fifteen minutes
@.Active_Start_Time = 000730 -- Start Time is seven and one half minutes after midnight
--@.Active_End_Time = 235959 -- End Time is next midnight
EXECsp_Add_JobServer
@.Job_Name ='jobDBBackupWedb_1Log'
GO
My opinion, I'd create DB Maint Plans to do database and trans log backups, and not write my own, unless there is some real good reason to. Main plans aren't perfect, but still better then trying to reproduce the same end result. One of the points of backing up the trans log is for disaster recovery. You could backup your trans log every 30 minutes, then copy/move those backups off to a different server/tape, etc... So, I wouldn't stack them on one file, becuase you need to move them continually to a different box, or yea, backup cross server, ehhhh.... I prefer local backups and then copying them somewhere else, like with RoboCopy. The times you nee the trans logs are for recovery, or to do log shipping to a different server (similar concept to database mirroring, but still more in use then mirroring is I think). If doing a full backup every 6 hours, same thing, back it up and move it off somewhere safe, not leave that on teh same drives as your database files! I'd still leave the old TRN files on teh other location, there COULD be a case where you need to go back 9 hours, then you'd have the old trans and backups to get there, I wouldnt delete the TRN files every 6 hours as you said.
Bruce
|||Thanks ... but ...
I'm backing up to a separate / different network drive on a different / separate server that my network admin has established as a SANs - Storage Area Network - drive. That SANs drive is data specific and is being snap-shot-backed-up every 5 minutes. Then it goes to tape every night at 11:00 PM.
The nature of the DB is that the WebEoc is for running the SEOC - State Emergency Operations Center - during hurricanes, earthquakes, etc.
|||I think that the problem with your original script is that you are creating the backup command when you create the job rather than dynamically creating and executing the command when executing the job.
Try the re-worked version below.
Chris
Code Snippet
USE msdbIF EXISTS ( SELECT Name
FROM sysjobs
WHERE Name = 'jobDBBackupWedb_1Log' )
EXEC sp_delete_job @.job_name = 'jobDBBackupWedb_1Log'
GO
DECLARE @.cmd NVARCHAR(3201)
SET @.cmd = N'DECLARE @.sql VARCHAR(8000)
DECLARE @.now char(14)
-- current date in the form of yyyymmddhhmmss
DECLARE @.dbName sysname
-- database name to include date-time-stamp
SET @.now = REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR(50), GETDATE(), 120), ''-'',
''''), '' '', ''''), '':'', '''')
SET @.dbName = ''Wedb_1_'' + @.now + ''_.trn''
SET @.sql = ''BACKUP LOG Wedb_1 TO DISK = '' + CHAR(39)
+ ''\\SERVER1\D$\SQLDatabases\Backup\WebEoc\'' + @.dbName + CHAR(39)
EXEC(@.sql)'
EXEC sp_add_job @.Job_Name = 'jobDBBackupWedb_1Log',
@.Description = 'Run Wedb_1 DB Backup Transaction Log Every 15 Minutes',
@.Category_Name = 'Database Maintenance'
EXEC sp_add_jobstep @.Job_Name = 'jobDBBackupWedb_1Log',
@.step_name = 'DB_Backup_Log', @.step_id = 1, @.Database_Name = 'Master',
@.subsystem = 'TSQL', @.command = @.Cmd
/*
Start time for the Transaction Log backups is seven and one half minutes after midnight
to not conflict with the Full database backups run every 6 hours starting at midnight.
The Transaction Log backups are to be run every fifteen minutes.
*/
EXEC sp_Add_JobSchedule @.Job_Name = 'jobDBBackupWedb_1Log',
@.Name = 'schedDB_BackupLog', @.Freq_Type = 4, -- Daily
@.Freq_Interval = 1, -- Each day
@.Freq_Subday_Type = 0x4, -- Interval in minutes
@.Freq_Subday_Interval = 15, -- Every fifteen minutes
@.Active_Start_Time = 000730
-- Start Time is seven and one half minutes after midnight
--@.Active_End_Time = 235959 -- End Time is next midnight
EXEC sp_Add_JobServer @.Job_Name = 'jobDBBackupWedb_1Log'
GO
|||
Chris,
Thank you very kindly! I take your comment about run-time, create/execute; that was spot on. Thanks for the code change - works like a charm ...
... but, I've looked and not found an answer, what is the "N" doing for me in SET @.cmd = N'DECLARE ... ?
Is it declaring that what follows is all an NVARCHAR string?
New Job Unable to Copy 200 Line Code Into Command Section
copy the 200 lines of code that I created into the command section of the job.
Is there away to expand the New Job Command section?
I cannot use another job step to resolve this issue because I have alot
variables and a cursor used in this job.
This problem is resolve in SQL Server 2005.
Please help me resolve this problem for SQL Server 2000.
Thank You,Joe K. wrote:
> I have a SQL Server 2000 database, I created a new job but I am unable to
> copy the 200 lines of code that I created into the command section of the job.
> Is there away to expand the New Job Command section?
> I cannot use another job step to resolve this issue because I have alot
> variables and a cursor used in this job.
> This problem is resolve in SQL Server 2005.
> Please help me resolve this problem for SQL Server 2000.
> Thank You,
>
200 lines of code in a single job step? That's just insane. Put that
code into a stored procedure, and then use a single EXEC statement in
the job step.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I fully agree with Tracy. If you, for some strange reason, don't want to do this, I believe the
limit is a bit higher at the TSQL level (i.e., the GUI is the limiting factor), so you could have
some more by using sp_add_jobstep.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message news:45BA5D73.3080102@.realsqlguy.com...
> Joe K. wrote:
>> I have a SQL Server 2000 database, I created a new job but I am unable to copy the 200 lines of
>> code that I created into the command section of the job.
>> Is there away to expand the New Job Command section? I cannot use another job step to resolve
>> this issue because I have alot variables and a cursor used in this job.
>> This problem is resolve in SQL Server 2005.
>> Please help me resolve this problem for SQL Server 2000.
>> Thank You,
>>
> 200 lines of code in a single job step? That's just insane. Put that code into a stored
> procedure, and then use a single EXEC statement in the job step.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
New Job Unable to Copy 200 Line Code Into Command Section
copy the 200 lines of code that I created into the command section of the job.
Is there away to expand the New Job Command section?
I cannot use another job step to resolve this issue because I have alot
variables and a cursor used in this job.
This problem is resolve in SQL Server 2005.
Please help me resolve this problem for SQL Server 2000.
Thank You,
Joe K. wrote:
> I have a SQL Server 2000 database, I created a new job but I am unable to
> copy the 200 lines of code that I created into the command section of the job.
> Is there away to expand the New Job Command section?
> I cannot use another job step to resolve this issue because I have alot
> variables and a cursor used in this job.
> This problem is resolve in SQL Server 2005.
> Please help me resolve this problem for SQL Server 2000.
> Thank You,
>
200 lines of code in a single job step? That's just insane. Put that
code into a stored procedure, and then use a single EXEC statement in
the job step.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
New Job Unable to Copy 200 Line Code Into Command Section
copy the 200 lines of code that I created into the command section of the jo
b.
Is there away to expand the New Job Command section?
I cannot use another job step to resolve this issue because I have alot
variables and a cursor used in this job.
This problem is resolve in SQL Server 2005.
Please help me resolve this problem for SQL Server 2000.
Thank You,Joe K. wrote:
> I have a SQL Server 2000 database, I created a new job but I am unable to
> copy the 200 lines of code that I created into the command section of the
job.
> Is there away to expand the New Job Command section?
> I cannot use another job step to resolve this issue because I have alot
> variables and a cursor used in this job.
> This problem is resolve in SQL Server 2005.
> Please help me resolve this problem for SQL Server 2000.
> Thank You,
>
200 lines of code in a single job step? That's just insane. Put that
code into a stored procedure, and then use a single EXEC statement in
the job step.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I fully agree with Tracy. If you, for some strange reason, don't want to do
this, I believe the
limit is a bit higher at the TSQL level (i.e., the GUI is the limiting facto
r), so you could have
some more by using sp_add_jobstep.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message news:45BA5D73.3080102@.realsqlguy.co
m...
> Joe K. wrote:
> 200 lines of code in a single job step? That's just insane. Put that c
ode into a stored
> procedure, and then use a single EXEC statement in the job step.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
Wednesday, March 7, 2012
New Id
I am using Microsoft Visual Studios 2005 Pro creating a web form in asp.net with a vb.net code page. I am trying to get the id of a newly inserted record. I am using the sqldatasource insert command to insert the record. Does anybody know how to return the new id. during the insert? Thanks, Any help is appreciated
there are basically 2 ways of doing that.
1. Create ID before you do insert using something like SELECT Max(id) +1 FROM ... Use this approach if you ID field is not set as a identity column
2. If your id field is an identity field then you can write a stored procedure that inserts the record and then you do something like
SET @.ID = scope_identity()
Where @.ID is your output parameter or you can return it as a return value.
|||
Here is a modified sample from Quickstarts tutorial with inline SQL for insert (ContactID is the Identity field of the table):
ProtectedSub SqlDataSource1_Inserted(ByVal senderAsObject,ByVal eAs System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)Response.Write("Record Inserted: " + Server.HtmlEncode(e.Command.Parameters("@.ContactID").Value.ToString()) +"<br/>")
EndSub
<asp:GridViewAutoGenerateColumns="False"DataKeyNames="ContactID"DataSourceID="SqlDataSource1"
ID="GridView1"runat="server">
<Columns>
<asp:CommandFieldShowDeleteButton="True"/>
<asp:BoundFieldDataField="ContactID"HeaderText="ContactID"InsertVisible="False"
ReadOnly="True"SortExpression="ContactID"/>
<asp:BoundFieldDataField="ContactName"HeaderText="ContactName"SortExpression="ContactName"/>
</Columns>
</asp:GridView>
<asp:SqlDataSourceConnectionString="<%$ ConnectionStrings:MSDN_forumConnectionString %>"ID="SqlDataSource1"
runat="server"SelectCommand="select ContactID, ContactName from Contacts"InsertCommand="INSERT INTO Contacts (ContactName) VALUES (@.contactName);SELECT @.contactID = Scope_Identity()"
OnInserted="SqlDataSource1_Inserted"DeleteCommand="DELETE FROM Contacts WHERE ContactID = @.ContactID">
<InsertParameters>
<asp:ParameterName="contactName"Type="String"/>
<asp:ParameterDirection="Output"Name="contactID"Type="Int32"/>
</InsertParameters>
<DeleteParameters>
<asp:ParameterName="ContactID"/>
</DeleteParameters>
</asp:SqlDataSource>
<br/>
<asp:DetailsViewAutoGenerateRows="False"DataKeyNames="ContactID"DataSourceID="SqlDataSource1"
DefaultMode="Insert"HeaderText="Insert New Contact"Height="50px"ID="DetailsView1"
runat="server"Width="125px">
<Fields>
<asp:BoundFieldDataField="ContactID"HeaderText="ContactID"InsertVisible="False"
ReadOnly="True"SortExpression="ContactID"/>
<asp:BoundFieldDataField="ContactName"HeaderText="ContactName"SortExpression="ContactName"/>
<asp:CommandFieldShowInsertButton="True"/>
</Fields>
</asp:DetailsView>
|||
orka777:
there are basically 2 ways of doing that.
1. Create ID before you do insert using something like SELECT Max(id) +1 FROM ... Use this approach if you ID field is not set as a identity column
2. If your id field is an identity field then you can write a stored procedure that inserts the record and then you do something like
SET @.ID = scope_identity()
Where @.ID is your output parameter or you can return it as a return value.
For Number 1, is correct but might no be that good even it will do the job for you.
For Number 2, the code should be like:
1SET @.MyIdentity =@.@.IDENTITY
Where @.MyIdentity in an output parameter of type int.
Here I prefere to not return the identity of the inserted record as an output parameter, I perefere to return it using the Return statment in the stored procedure., like:
1CREATE PROCEDURE MySP23AS45SET NOCOUNT ON67declare MyIdentityint-- as a normal variable in the stored procedure body89Insert Into MyTable (col1, col2)values ('A','B')10SET @.MyIdentity =ISNULL(@.@.IDENTITY,-1)-- if no record is inserted then you will get -1111213Return @.MyIdentity1415SET NOCOUNT OFF16 Good luck.|||
I am trying to do this through the sqldatasource1.insert statement that I have built using the querybuilder. When I try to put in the @.ID as an output or as a return value It says I need to declare the scalar variable. I have already added in the parameters area and it is set to output with the control being the textbox that I want the Id in. But when I add the line "SET @.NewID = scope_identity()" or "SET @.NewID = @.@.identity" then I get an error on both @.NewId and @.SN which is another scalar variable which normally works fine and works fine again after I pull that line out. But I'm not doing it as a stored procedure. Could that be the problem? I don't know about stored procedures. How do I create them?
Carehalf:
I don't know about stored procedures. How do I create them?
Just check my last post, it is a complete running fine example.
Anyway.. here is a very simple example:
1CREATE PROCEDURE MyStoredProcedureName2@.MyInputParameterint,-- input parameter of type integer3@.MyOutputParameterint OUTPUT-- output parameter of type integer45AS67-- write you statments here8-- and here9-- and here as well :)1011-- how to set a value for ourput parameter12SET @.MyOutputParameter = 100-- just for example1314-- how to increment the input parameter by 1 (for example)15SET @.MyInputParameter = @.MyInputParameter + 1161718/* At the end you the @.MyOutputParameter output parameter value19 will be 100 (as per the logic in this simple example20 Did you see how easy it is to created a stored procedure? */21
Good luck.
||| I understand the stored procedure from looking at your last statement and this one, but I am not sure where to create it
Carehalf:
I understand the stored procedure from looking at your last statement and this one, but I am not sure where to create it
Create you stored procedures in your application/project database.
Example:
USE MyDatabase
GO
Then the CREATE PROCEDURE statment as in my last two posts.
Good luck.
|||Carehalf:
Create a table in your database and copy the code sample I posted (change the connection string in the code) and check the syntax to work for you if you don't want to create the Stored Procedure.
Here is the table definition:
CREATETABLE [dbo].[Contacts](
[ContactID] [int]IDENTITY(1,1)NOTNULL,
[ContactName] [nvarchar](50))
Monday, February 20, 2012
New Crystal report question
critalic|||how about in underline? what is the command code? thanks :)