.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 21st, 2003, 12:37 PM
Watever Watever is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Montreal, Canada
Posts: 486 Watever User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 20 sec
Reputation Power: 6
OleDbAdapter Error when program Start ? msgbox show

Hi,

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 ?
__________________

Reply With Quote
  #2  
Old October 23rd, 2003, 11:43 AM
Watever Watever is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Montreal, Canada
Posts: 486 Watever User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 20 sec
Reputation Power: 6

Reply With Quote
  #3  
Old October 28th, 2003, 10:58 AM
Watever Watever is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Montreal, Canada
Posts: 486 Watever User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 20 sec
Reputation Power: 6
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.

Reply With Quote
  #4  
Old October 29th, 2003, 03:30 PM
Pain Pain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Sheffield, UK
Posts: 94 Pain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to Pain
Something like this:

OleDbConnection1.Open()

Try
'your stuff here


Catch ex As Exception 'error handling
'tidy up
OleDbConnection1.Close()
MsgBox(ex.ToString)

End Try


Reply With Quote
  #5  
Old October 30th, 2003, 09:38 AM
Watever Watever is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Montreal, Canada
Posts: 486 Watever User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 20 sec
Reputation Power: 6
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > OleDbAdapter Error when program Start ? msgbox show


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT