Sunday, March 11, 2012
"SQLServerAgent service hung on starting"
EventID 7022
SERVICE CONTROL MANAGER
"SQLServerAgent service hung on starting"
Any idea how to solve this or what causes this?Take a look at your SQL Error log. SQL Server Agent will not be able to start unless the error log shows 'Recovery Complete'.|||Check your odbc administrator -> tracing -> check to see if it is enabled (if it is, stop the tracing).|||Thanks for your replies. Problem solved, the error message was caused because I also disabled the Messenger service (for security reasons). Now I enabled it again & the SQGAgent Service starts on reboot without the error warning. I still wonder why because I don't like leaving the Messenger service running.
"Server has not yet been opened" - XP
Code;
'* Start creating the crystal report for the crystal viewer.
Set crystal = New CRAXDRT.Application
Set sRPT = crystal.OpenReport(App.Path & "\DailyIS.rpt")
sRPT.DiscardSavedData
DoEvents
sRPT.Database.Tables(1).SetLogOnInfo "oracle", gDSN, gUserID, gPassWord
sRPT.Database.SetDataSource RS
crViewer.ReportSource = sRPT
crViewer.ViewReport '* (Where the error pops up)
Any ideas what my Windows XP issue might be?'* Start creating the crystal report for the crystal viewer.
Set crystal = New CRAXDRT.Application
Set sRPT = crystal.OpenReport(App.Path & "\DailyIS.rpt")
sRPT.DiscardSavedData
DoEvents
sRPT.Database.SetDataSource RS
crViewer.ReportSource = sRPT
crViewer.ViewReport '* (Where the error pops up)
if you are set ADODB.recordset in CR you don't need
sRPT.Database.Tables(1).SetLogOnInfo "oracle", gDSN, gUserID, gPassWord|||Thank you hensa22 for that information. I commented out that line of code and ran the report in Windows 2000 and received the message "Server has not yet been opened.", but the report displays with that line of code left in. In Windows XP I receive the message "Server has not yet been opened." with or without the code.
Tuesday, March 6, 2012
"Object reference not set to an instance of an object" When Retrieving Data/Schema in Desi
Hi There,
This is related to a ms access database but since I use the SqlDataSource control I thought I should post here.
I have a project that I was working on with this ms access db and using sql controls, everything was working just fine
since one day I started getting "Object reference not set to an instance of an object" messages when I try to design
a query or retrieve a schema, nothing works at design time anymore but at runtime everything is perfect, its a lot
of work for me now to create columns,schemas and everything manually, I've tried reinstalling visualstudio, ado components
but nothing seems to fix it, did this ever happen to any of you guys?
any tip is really appreciated
thanks a lot
Hi faguiar,
You wouldn't have to use DataSet Typed. You should have to use BusinessEntities.
Good Coding!
Javier Luna
http://guydotnetxmlwebservices.blogspot.com/
but it used to work fine before, I'm pretty sure this is a nasty ide bug that needs a hack but I can't find a solution myself.
thank you
Sunday, February 19, 2012
"IF"s in a view?
In SQL Server, Microsoft seems to only allow the use of control statements such as IF and CASE in Stored Procedures but not in a view.
Question: Is there any way to use "IF" or "CASE" in a view? If a stored procdure is the best route, how do i access the results set afterwards?Case works fine - please post the view you tried to create.|||Here is the SQL fragment converted from ACCESS IIF's to SQL Server CASE. I don't have access to the SQL Server at the moment but I will try out your suggestion first chance I get.
CASE
WHEN [IncidentHeaderDynamicsCustNmbr] Like '99900%' THEN
[CustName],
[CntcPrsn],
[StmtName],
[Address1],
[Address2],
[City],
[State],
[Country],
[Zip],
[Phone1],
[Phone2],
[Fax],
WHEN IsNull(IncidentHeaderSiteID])=True And IsNull(IncidentHeaderClientAddressID])=True) THEN
[CustName],
[CntcPrsn],
[StmtName],
[Address1],
[Address2],
[City],
[State],
[Country],
[Zip],
[Phone1],
[Phone2],
[Fax],
ELSE
Trim([IncidentHeaderSiteCustName]))) AS InvoiceHeaderSiteCustName,
Trim([IncidentHeaderSiteCntcPrsn]))) AS InvoiceHeaderSiteCntcPrsn,
Trim([IncidentHeaderSiteStmtName]))) AS InvoiceHeaderSiteStmtName,
Trim([IncidentHeaderSiteAddress1]))) AS InvoiceHeaderSiteAddress1,
Trim([IncidentHeaderSiteAddress2]))) AS InvoiceHeaderSiteAddress2,
Trim([IncidentHeaderSiteCity]))) AS InvoiceHeaderSiteCity,
Trim([IncidentHeaderSiteState]))) AS InvoiceHeaderSiteState,
Trim([IncidentHeaderSiteCountry]))) AS InvoiceHeaderSiteCountry,
Trim([IncidentHeaderSiteZip]))) AS InvoiceHeaderSiteZip,
Trim([IncidentHeaderSitePhone1]))) AS InvoiceHeaderSitePhone1,
Trim([IncidentHeaderSitePhone2]))) AS InvoiceHeaderSitePhone2,
Trim([IncidentHeaderSiteFax]))) AS InvoiceHeaderSiteFax,
END|||The problem looks like with your syntax (check out BOL) - the case statement goes as follows:
CASE input_expression
WHEN when_expression THEN result_expression
[...n]
[
ELSE else_result_expression
]
END
or
CASE
WHEN Boolean_expression THEN result_expression
[...n]
[
ELSE else_result_expression
]
END
Anyway, you have case when - but you are missing the end statement - Maybe you are thinking you can return multiple results - You will have to test for each case.
