Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2007
    Posts
    2

    Unanswered: vb 6.0 app odbc dsn workd fine win2000, but fails in WINXP

    Dear freinds,

    My vb 6.0 sql server 2000 application, in which dsn is created programaticlly,
    it works fine in win98, win 2000 professional, for many years.

    but odbc connections fails in xp machine

    can somebody advise, my code is given below

    Public Sub CreateDSN()
    'Constant Declaration
    'Function Declare
    On Error GoTo Display

    #If Win32 Then
    Dim intRet As Long
    #Else
    Dim intRet As Integer
    #End If
    Dim strDriver As String
    Dim strAttributes As String

    strAttributes = strAttributes & "DESCRIPTION=My Company" & Chr$(0)
    strAttributes = strAttributes & "DSN=" & DataSourceName & Chr$(0)
    strAttributes = strAttributes & "DATABASE=" & DatabaseName & Chr$(0)
    strAttributes = strAttributes & "Trusted_connection=yes" & Chr$(0)

    'strAttributes = strAttributes & "User=sa;pwd=;" & DatabaseName & Chr$(0)
    'To show dialog, use Form1.Hwnd instead of vbAPINull.
    intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, _
    strDriver, strAttributes)
    Exit Sub
    Display:
    ' MsgBox Err.Description
    MsgBox Err.Number
    End
    End Sub

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

  3. #3
    Join Date
    Dec 2007
    Posts
    2

    vb 6.0 app odbc dsn workd fine win2000, but odbc fails in WINXP after 1 hour use

    Code:
    Public Sub CreateDSN()
    'Constant Declaration
    'Function Declare
    On Error GoTo Display
    
    #If Win32 Then
    Dim intRet As Long
    #Else
    Dim intRet As Integer
    #End If
    Dim strDriver As String
    Dim strAttributes As String
    
    strAttributes = strAttributes & "DESCRIPTION=My Company" & Chr$(0)
    strAttributes = strAttributes & "DSN=" & DataSourceName & Chr$(0)
    strAttributes = strAttributes & "DATABASE=" & DatabaseName & Chr$(0)
    strAttributes = strAttributes & "Trusted_connection=yes" & Chr$(0)
    
    'strAttributes = strAttributes & "User=sa;pwd=;" & DatabaseName & Chr$(0)
    'To show dialog, use Form1.Hwnd instead of vbAPINull.
    intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, _
    strDriver, strAttributes)
    Exit Sub
    Display:
    ' MsgBox Err.Description
    MsgBox Err.Number
    End
    End Sub
    edited by loquin: please don't make a new thread for the same topic.
    Last edited by loquin; 12-18-07 at 02:48.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •