|
WTF, who was the evil bastard who architected this abomination. With so many competing and disparate layers you are going to get insane problems like this one! When it come down to the point where the solution is based on a print statement I would want nothing to do with it. run away, run away very fast
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
LOL! I've been saying the same thing for three years. Either I'll convince someone that we need to write our own application to replace this one, or hope the vendor moves away from this model.
|
|
|
|
|
Hello !
i try to use the command
DoCmd.OutputTo acOutputReport, RptName, "SnapshotFormat(*.snp)", _
strPathandFileName
Works just fine. I want this process to be automatic and hidden from the user, but a window pops up with a "Cancel" button. I don't want to allow the user the cancel option, and I'd prefer to have that pop-up window be invisible. Can I do either of these things:
1. Prevent that window from popping up (or make it invisible)
in lieu of that,
2. Change that popup window to have no Cancel button.
Help me !
Thank you in advance.
|
|
|
|
|
|
Thank you !
I try this but doesn't work.
|
|
|
|
|
The Office Suite is meant for interactive use, and will pop up all kinds of dialogs when it sees fit. AFAIK there isn't much you can do about that.
Of course you don't need the Access application, you could create your own app (with GUI and business logic) and use OLEDB and an access database file as the data store. That won't pop up anything you didn't design.
|
|
|
|
|
I have created a sp
in which i have used @@rowcount with while but it is not working
e.g
Select * from #temp
print @@rowcount
while @@rowcount <> 0
begin
----
----
---
end
the print command is giving rowcount 1 but still it is not working
One person's data is another person's program.
--J.Walia
|
|
|
|
|
Remove that print @@rowcount
or declare a variable and set the @@rowcount into that variable and use that variable further.
DECLARE @rc AS INTEGER
Select * from #temp
SET @rc = @@rowcount
print @rc
while @rc <> 0
begin
----
----
---
end
|
|
|
|
|
This is because the @@ values get reset when an action (print) executes.
|
|
|
|
|
I am in great confusion. I wrote a sql function to find the day of week.My query is shown below:
ALTER FUNCTION dbo.udf_DayOfWeek
(@dtDate datetime)
RETURNS VARCHAR(10)
AS
BEGIN
DECLARE @rtDayofWeek VARCHAR(10)
SELECT @rtDayofWeek = CASE DATEPART(weekday,@dtDate)
WHEN 1 THEN 'Sunday'
WHEN 2 THEN 'Monday'
WHEN 3 THEN 'Tuesday'
WHEN 4 THEN 'Wednesday'
WHEN 5 THEN 'Thursday'
WHEN 6 THEN 'Friday'
WHEN 7 THEN 'Saturday'
END
RETURN (@rtDayofWeek)
END
GO
Call this function like this:
SELECT dbo.udf_DayOfWeek('8/27/2010') AS DayOfWeek
But I have to get output when fromdate and todate is given.ie:When fromdate='8/25/2010' and todate='8/27/2010',then the output is wednesday,Thursday,Friday..How to wrie sql function for this.Please modify the above code..Hope u will understand my problem
Thanks in advance
|
|
|
|
|
So change your function to take 2 dates and return a table
In your function create a table variable with 1 or 2 fields (date and DoW)
insert the dates and calc the DoW
return the table to the procedure
You can then do a join between the date passed in abd the date in the result set.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If you use DATEPART(dw,'8/27/2010') that will give you a day of week. This may need adjusted for how the sys date is set. Also see @@datefirst
|
|
|
|
|
DECLARE @rtDayofWeek VARCHAR(10)
DECLARE @dtDate datetime
DECLARE @endDate datetime
SET @dtDate = '8/25/2010'
SET @endDate = '8/27/2010'
WHILE @dtDate <= @endDate
BEGIN
SELECT @rtDayofWeek = CASE DATEPART(weekday,@dtDate)
WHEN 1 THEN 'Sunday'
WHEN 2 THEN 'Monday'
WHEN 3 THEN 'Tuesday'
WHEN 4 THEN 'Wednesday'
WHEN 5 THEN 'Thursday'
WHEN 6 THEN 'Friday'
WHEN 7 THEN 'Saturday'
END
PRINT @rtDayofWeek
SET @dtDate = DATEADD(Day,1,@dtDate)
END
Hope this helps buddy
None
|
|
|
|
|
Hello !
i'm developping an ms-access database , and i need to send emails with attachment.i use CDO to send emails.
this is my code :
-------------------------------------------------
Dim cdoConfig As Object
Dim msgOne As Object
With cdoConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.yahoo.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myusername"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
.Update
End With
Set msgOne = CreateObject("CDO.Message")
Set msgOne.Configuration = cdoConfig
msgOne.To = "adress@hotmail.com"
msgOne.From = "myusername@yahoo.com"
msgOne.Subject = "test"
msgOne.TextBody = "this is a test"
msgOne.AddAttachment "c:\test.txt"
msgOne.Send
-------------------------------------------------
The code is working but only sometimes.So i send email , no error is displaying , but the email is not received , or in rare cases the email arrive after 3-4 hours or more.but in 30 emails sended only 1 or 2 arrives.
Is very strange because i don't get any error message.
Can you help me !
Thank you in advance.
|
|
|
|
|
Maybe Yahoo mail can be slow!
Try to use gmail smtp and see if same happens with gmail too.
Pershendetje!
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Hello !
Thank you for your response.
Is the same thing with gmail, hotmail , yahoo and with other domains.The emails are too slow ore never received.Another thing that i notice today is that mos of CDO emails that are received , are marked as spams.When i send emails with the same accounts but not with CDO everything is OK.
What can i do ?
Thank you.
|
|
|
|
|
Mail sent using CDO is sent from the machine you're running it from. I believe there's a way to send the mail via a mail server by using server (I could be wrong); however, due to security concerns this isn't often done.
Most firewall and anti-virus applications will also catch this sort of thing unless it's configured to allow mail to be sent out.
I would recommend interop with outlook, since the libraries for this are available when outlook is installed.
http://support.microsoft.com/kb/310263[^]
Working in an exchange environment, I wound up using MAPI for one of my solutions. A quick search on CP for "MAPI" will yield several options for you.
|
|
|
|
|
Thank you !
But i want to send email from inside my application without open outlook window.I have all the information like SMTP server , username , password , smtp port ...etc.so what's wrong with CDO ?Is CDO usable or not ?
|
|
|
|
|
CDO will work if you're only ever sending to a single address and you have your anti-virus/firewall configured to allow emails to be sent out originating from your computer; and if you allow spam from your origin address on the destination account. If you're looking to email end users with a non-static address, I recommend looking into other solutions.
|
|
|
|
|
Hi all,
Could You please let me know how to trace a Stored Procedure modifications history within a certain period of time? Including the conetnet of a Stored Procedures at a particular period of time.
Many thanks for your help.
|
|
|
|
|
Source control software? If you are using TFS then that provides source control as well.
|
|
|
|
|
Thanks very much for your response.Its much appreciated.I didnt have TFS ,I am just running Sql 2008 and wated to know the content of a particular Stored procedure at one time back before modification.
Please advice.
|
|
|
|
|
Have a database project in your code which will have all the scripts logically placed in separate folders. Database will not do this for you. Either usea source control software or take regular backups. Former, IMHO, is simpler and suitable for your requirement.
If you don't have a DB backup, you cannot revert back unless you manually edit things.
|
|
|
|
|
We use code version tool. We also include the version number as comments in stored procedures and functions. Out versioning tool automatically applies the versioning comments.
|
|
|
|
|
As d@nish said, you'd best keep a copy of your procedures in a safe location. The database itself doesn't version the procedures, there's no change-history by default.
Try restoring a database-backup that contains the correct version of the sp's.
--edit; (to prevent this)
- Script your entire database, in the version that you're releasing to the customer(s).
- Archive them somewhere safe (SourceSafe - don't forget to label it, or even burned and nicely indexed on CD)
- Include all unit-tests for your procdures!
- Consider whether the sprocs have any dependencies themselves, like functions, views or other procedures.
- A scripter[^] might come in handy.
I are Troll
modified on Thursday, August 26, 2010 6:22 PM
|
|
|
|