October 21st, 2003, 11:37 AM
OleDbAdapter Error when program Start ? msgbox show
I have a little problem in my program.
I use OledbAdapter and Dataset etc... My problem is that when the program start the adapters try to connect to the SQL Database to populate de dataset etc...
But my database is on a Sql Server and it's not everyone that have access to it. The Administrator have to give him the rights before he can access any tables. So if the user doesn't have the rights then a Pop-Up from Vb.Net tell the user that an error occured while connecting the OleDbAdapters.
Instead of that message, I would like to put a message box that will tell my user that he doesn't have the right to connect to the SQL Server and to contact his network administrator.
soo how does I do that ?
I don't have access to the code of the Adapter that connect the dataset to the database. I would like to do a sort of Try Catch but when and where ?
Anybody ever got a problem like that ? How you solve it ?
October 23rd, 2003, 10:43 AM
October 28th, 2003, 09:58 AM
I have not been working on it for a while. But now I need to work on it, and I still don't know how I can solve that kinda little problem. It's damn stupid but users are stupid and I hate code 13, soo you try your best that it doesn't happens
soo if anyone have any idea, your help will be appreciate.
October 29th, 2003, 02:30 PM
Something like this:
'your stuff here
Catch ex As Exception 'error handling
October 30th, 2003, 08:38 AM
Thank You Pain for your help but I don't think I can do that.
My problem occur before I can do any code. It's just itiliasize my form and then he create the object and when he create the oleadapters objects he bug there cause he don't have access. That's what it's look like.
I will try to see what I can do. don't know how yet but were would be the fun if we don't need to do some research