Click here to Skip to main content
15,920,602 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralExplorer Band using VB Pin
Member 123770718-Aug-04 2:10
Member 123770718-Aug-04 2:10 
GeneralHelp with security Pin
axehead6917-Aug-04 20:34
axehead6917-Aug-04 20:34 
GeneralRe: Help with security Pin
Dave Kreskowiak18-Aug-04 3:47
mveDave Kreskowiak18-Aug-04 3:47 
GeneralQuestion regarding Garbage Collector Pin
AstronusX17-Aug-04 12:38
AstronusX17-Aug-04 12:38 
GeneralRe: Question regarding Garbage Collector Pin
S Sansanwal17-Aug-04 13:43
S Sansanwal17-Aug-04 13:43 
GeneralDatabase repair Pin
benjj17-Aug-04 11:23
benjj17-Aug-04 11:23 
GeneralRe: Database repair Pin
Dave Kreskowiak18-Aug-04 3:37
mveDave Kreskowiak18-Aug-04 3:37 
Generalsilly exception question Pin
kowplunk17-Aug-04 10:34
kowplunk17-Aug-04 10:34 
I have various classes in my data access layer that are talking with the database. for all the methods I pass in the connection ref. Now if the connection object is being passed in from the outside and within the da classes there is a try catch block is it necessary to enclose the methods call within a try catch finally block to close the connection in the finally? You would think that any exceptions that are thrown will be caught internally and there for the connection will still be able to be close even if it is not in a finally block in the outer function.

private sub formMethod()
...
conn.open 'not sure if this has to be in the t/c block
someDAMethod()
conn.close 'connection should still be closed, right?
end sub

..in da module
public sub someDAMethod()
try
...
catch sqlEx as sqlException

end try
end sub

I guess you could say that you are only catching sqlExceptions so you still have to do the other catch, but you could always catch the base exception, as long as you know that the update didn't go through properly.

I am still new to dealing with exceptions properly, so if it is a dumass question sorry. I am just curious.
GeneralRe: silly exception question Pin
Dave Kreskowiak18-Aug-04 3:30
mveDave Kreskowiak18-Aug-04 3:30 
GeneralRe: silly exception question Pin
kowplunk18-Aug-04 4:11
kowplunk18-Aug-04 4:11 
GeneralReading data from a printer Pin
tpiotr17-Aug-04 8:41
tpiotr17-Aug-04 8:41 
GeneralRe: Reading data from a printer Pin
Dave Kreskowiak18-Aug-04 3:16
mveDave Kreskowiak18-Aug-04 3:16 
Generalthe system speaker Pin
udi3217-Aug-04 8:29
udi3217-Aug-04 8:29 
GeneralRe: the system speaker Pin
Daniel Turini17-Aug-04 9:40
Daniel Turini17-Aug-04 9:40 
GeneralRe: the system speaker Pin
udi3219-Aug-04 14:07
udi3219-Aug-04 14:07 
Questionis this VBA? Pin
Pablo.ar17-Aug-04 6:51
Pablo.ar17-Aug-04 6:51 
AnswerRe: is this VBA? Pin
Dave Kreskowiak17-Aug-04 10:32
mveDave Kreskowiak17-Aug-04 10:32 
GeneralRe: is this VBA? Pin
Pablo.ar17-Aug-04 16:12
Pablo.ar17-Aug-04 16:12 
QuestionHow to close child windows?? Pin
viettho17-Aug-04 6:15
viettho17-Aug-04 6:15 
AnswerRe: How to close child windows?? Pin
Dave Kreskowiak17-Aug-04 10:29
mveDave Kreskowiak17-Aug-04 10:29 
Generalimporting fortran dll's Pin
alankrita17-Aug-04 5:54
alankrita17-Aug-04 5:54 
GeneralRe: importing fortran dll's Pin
Dave Kreskowiak17-Aug-04 10:26
mveDave Kreskowiak17-Aug-04 10:26 
GeneralRe: importing fortran dll's Pin
progload17-Aug-04 15:19
progload17-Aug-04 15:19 
GeneralRe: importing fortran dll's Pin
progload17-Aug-04 15:24
progload17-Aug-04 15:24 
GeneralwaveOutGetDevCaps Pin
mivey417-Aug-04 5:14
mivey417-Aug-04 5:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.