Re: Problems with views from Firebird

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 04/13/04


Date: Tue, 13 Apr 2004 10:14:44 -0400

Cecil Westerhof wrote:
> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:OWosEXVIEHA.3444@TK2MSFTNGP11.phx.gbl...
>> Cecil Westerhof wrote:
>>> I have to maintain code written by someone else. It makes extensive
>>> use of dynamic views and stored procedures. The strange thing is
>>> that when we execute the statement "DROP VIEW MV_22_", that it
>>> never gives an error, but is not always done.
>>
>> First of all, you need to figure this out. No error? That's just not
>> right! Are you using On Error Resume Next? If so, are you checking
>> the Err object immediately after attempting to execute this line?
>> Are you checking the connection's Errors collection?
>
> That is what I would think. I use On Error Resume Next, but after
> this I check the Err object. The code:
>
> on error resume next
> oOrgDbConn.BeginTrans
> DropStr = "DROP VIEW " & arrViewNames(arrIndex)
> f.WriteLine Now() & " " & "trying to drop view "
> f.WriteLine Now() & " " & DropStr
> oOrgDbConn.execute DropStr, adExecuteNoRecords

That's strange, you are missing an argument. It should be:
oOrgDbConn.execute DropStr, ,adExecuteNoRecords

> If(Err.number <> 0) Then
> 'Execution failed
> f.WriteLine Now() & " " & "Did NOT succeed"
> f.WriteLine Err.Description & vbCrLf & Err.number
> closeConnections true
> errorRaised "S000402",""
> else 'Execution succeeded
> on error goto 0
> f.WriteLine Now() & " " & "Did succeed"
> oOrgDbConn.CommitTrans

You should check for an error here. The error might not occur until the
transaction is committed.

I don't understand why he used an explicit transaction for a single
statement's execution, anyways. It is not needed: there will be an implicit
transaction. Instead of adding more error-checking, just comment out the
begintrans and committrans statements.

> I did this also. But they opted for something with Crystal Report.
> This needs a recordset. Because the way the data is organised, it is
> only to get a recordset with a view.

Again, I question this statement. Not with the idea that a view is needed.
It's the "dynamic" part I question, but you know the application ...

> I allready wanted to rewrite the
> code, but I am not allowed, because 'It works'. The only problem is
> that the system has to be rebooted after every report. Another
> problem is that there are more then 20 reports, so my boss is afraid
> about the time it will take to rewrite everything. (He does not see
> how much time I allready spend on it.)

That is a problem. Start documenting your time, I guess. And the server's
downtime.

Bob Barrows

-- 
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Relevant Pages

  • Re: A closer look at the story of Cameron Todd Willingham, one of the several likely innocents that
    ... Rick Perry should be awarded for following GOD's kill'em all" Old ... famed arson analyst Gerald Hurst to take a fresh look at the case. ... Willingham?s attorney rushed the report to the office of Governor Rick ... Perry on Feb. 13, just four days before the scheduled execution, Cox ...
    (rec.sport.pro-wrestling)
  • Re: Extreme performance issues (SQL Server 2000/ADO.NET/C#)
    ... there is an "implied" transaction that's handled ... I would hit the SQL Server list... ... However, if the parameters change, the optimal query plan ... difference in execution time between QA and the application. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Effecting run time change in behavior
    ... We have implemented a OO language called Indus that is an extension of ... separates program execution from execution environment (that enables ... the transaction management problem has come up wrt to the e) ... These tx keywords in turn invoke the Transaction manager (a separate ...
    (comp.object)
  • SmtpMail.send() does _not_ cause button click to block . . .
    ... report to a number of email recipients. ... and then the debugger pops back into the code at ... that the execution of Sendis taking too long and somehow putting it ... this library will be driven from from a windows service ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Invalid Syntax
    ... I no longer recieve the parameter check, but when the report comes up it ... shows and #Error Message in all of the columns. ... If what you're trying to do is add a computed field Execution to your query, ... Copy and paste the SQL text to ...
    (microsoft.public.access.gettingstarted)