|
-
May 26th, 2005, 10:55 AM
#1
Thread Starter
Lively Member
Catching an error for a missing ODBC driver...
Where would I put a Try/Catch statement to check if a user has an ODBC driver for my app, and what exception do I use?
CP
-
May 26th, 2005, 01:59 PM
#2
Thread Starter
Lively Member
Re: Catching an error for a missing ODBC driver...
I'm putting this in the Form_Load routine since I already know it's an ODBC exception:
VB Code:
Dim odbcerr As New frmDriverError
Try
con.ConnectionString = "my;super;long;connection;string"
Catch ox As Odbc.OdbcException
odbcerr.ShowDialog()
End Try
And so the frmDriverError form has a link to download the right driver.
Is this the right place to put this?
Thanks,
CP
When I say 'jump', don't waste time asking 'how high?'.

Just a poor, dumb wanna-be programmer.
-
May 26th, 2005, 02:18 PM
#3
Re: Catching an error for a missing ODBC driver...
no because all you are doing there is setting a string property of the con object. You want to error catch when you actually try to use the connection. Generally this is when you call the OPEN method of the connection. That will throw an error if it fails, which is what you are going to want to catch
-
May 26th, 2005, 02:27 PM
#4
Thread Starter
Lively Member
Re: Catching an error for a missing ODBC driver...
When I say 'jump', don't waste time asking 'how high?'.

Just a poor, dumb wanna-be programmer.
-
May 26th, 2005, 07:34 PM
#5
Thread Starter
Lively Member
Re: Catching an error for a missing ODBC driver...
Of course I don't know it if will really work because I can't duplicate the error on my machine because, naturally, I already have the drivers; or if I'm even directing the user to download the right thing... odbc_net.msi for connecting to a PostgreSQL db, but I think so.
When I say 'jump', don't waste time asking 'how high?'.

Just a poor, dumb wanna-be programmer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|