|
-
Sep 24th, 2007, 03:31 AM
#1
Thread Starter
New Member
[RESOLVED] Does any one know how to fix this adodc control problem?
Here is the problem:
I use Adodc control in vb6.0 to access sql server,everything works fine until when the network failed.
the code simply like this:
<pre>
On Error ErrHandle
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;user id=sa;password=123456;initial catalog=test;data source=192.168.1.23\SQLEXPRESS;Connect Timeout=30"
Adodc1.Recordset.Properties("prompt") = adPromptNever
Adodc1.RecordSource = "select *from admin"
Adodc1.Refresh
'other code
ErrHandle:
'do nothing
</pre>
when the code run to Adodc1.Refresh,it pop up an error dialog with message "[DBNETLIB][ConnectionOpen (Connect()).]SQL Server Not Exist or Access Denied"
It's normal that you can't access data base when the network is not working,but since my program is runing at the server host I don't want it to click the dialog all the time when it can't connect to sql server.
So is there some way that can avoid the error dialog? and let it goto ErrHandle Section
I have being run into this problem for several months, any advice would help.
thank you.
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
|