RE: ODBC/DAO Connection timeout dialog



Hi ZV,

Try to create a new workspace like the following and the dialog box will
not be shown again.

Private Sub OpenDatabase()
Dim cs As String
Dim cn As DAO.Database
Dim ws As DAO.Workspace
Set ws = DBEngine.CreateWorkspace("", "", "", dbUseODBC)
cs = "ODBC;DRIVER=SQL Server;SERVER=webcache;DATABASE=news;APP=Visual
Basic; WSID=wks3;UID=user;PWD=aaa"

On Error Goto err

Set cn = ws.OpenDatabase("DSN", dbDriverNoPrompt, True, cs)
msgbox "ok"
cn.close
Exit Sub
err:
Debug.Print "Error opening connection"
End Sub

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

.



Relevant Pages

  • Project Error
    ... Private Declare Sub Sleep Lib "Kernel32" ... Dim strDataSrc As String ...
    (microsoft.public.vb.bugs)
  • Re: Is there a way to prevent a RichTextBox from scrolling?
    ... Private _isRegex As Boolean ... Public Sub New(ByVal thispattern As String, ... Dim entry As tDict ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Excel Listing tool using VB
    ... Sub ListFiles2() ... Dim directories() As String, CurrentDirectory As String ... Dim dirtopaste, dirok ...
    (microsoft.public.vb.general.discussion)
  • Form Error
    ... SMSDS_CallerID As String ... Private Declare Sub Sleep Lib "kernel32" ... Dim ComString As String ... Dim AppPath As String, FreeFileNo% ...
    (microsoft.public.vb.bugs)
  • Re: Encrypt/hide Password
    ... Public Sub New(ByVal strCryptoName As String) ... ' instantiated crypto class. ... Dim fsKey As New FileStream(strSaveToPath, FileMode.OpenOrCreate, _ ...
    (microsoft.public.scripting.wsh)