Re: Problems with views from Firebird
From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 04/13/04
- Next message: Aaron Bertrand [MVP]: "Re: Search for Date/Time already scheduled"
- Previous message: Joe...B: "Re: Dynamic invisable spacer"
- In reply to: Cecil Westerhof: "Re: Problems with views from Firebird"
- Next in thread: Cecil Westerhof: "Re: Problems with views from Firebird"
- Reply: Cecil Westerhof: "Re: Problems with views from Firebird"
- Messages sorted by: [ date ] [ thread ]
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.
- Next message: Aaron Bertrand [MVP]: "Re: Search for Date/Time already scheduled"
- Previous message: Joe...B: "Re: Dynamic invisable spacer"
- In reply to: Cecil Westerhof: "Re: Problems with views from Firebird"
- Next in thread: Cecil Westerhof: "Re: Problems with views from Firebird"
- Reply: Cecil Westerhof: "Re: Problems with views from Firebird"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|