Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004

    Unanswered: ADO / RDS problem??


    I am trying to prepare a program so that trying to access a database which will be installed on remote server.

    I use this code lines:
    Dim rs As Recordset
    Dim oConn As Connection
    Dim Query As String

    Set oConn = New Connection

    oConn.Open "Provider=MS Remote;" & _
    "Remote Server=;" & _'test for local
    "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=d:\inetpub\wwwroot\DB.mdb", _
    "admin", ""

    Query = "SELECT * FROM TableA"

    Set rs = New Recordset

    With rs
    .ActiveConnection = oConn
    .CursorLocation = adUseClient
    .Open Query 'problem occur here
    End With

    If rs.EOF() = True Then
    Exit Sub
    End If

    The database is access and server is ISS 5.0. When I try to connect as local host to test this code, Error 8447 (Internal Server Error) occured. After I changed some parameters on ISS , I run this codes again and a prompt screen asks username and password but never definded them before , Error 8208 occurs.

    Where I am wrong? Thanks for your replies.

  2. #2
    Join Date
    May 2004
    'test for local

    Can you put a comment on a line continuation like that? Interesting. I'll have to try that.

  3. #3
    Join Date
    Nov 2004
    there is no comment there, in real code. it put it there to make explanation for this forum so that what I did to test the code. I mean, forget about the comments.

    any suggestion?

  4. #4
    Join Date
    Nov 2004
    Provider=;Password=;Persist Security Info=;User ID=;Initial Catalog=;Data Source=

    When you are not sure about how to set your connection use a create a udl
    create an empty text file
    change it's extension to udl
    double click the file and fill the fields
    save and close
    then open with notepad and copy the connection string or
    use the udl file as your connection string
    Private Sub Connect() 
        Dim MyConnection
        Set MyConnection = New ADODB.Connection ' ADO 2.5    
        On Error Resume Next
        With MyConnection
            .ConnectionString = "File Name=C:\test.udl"
            .CursorLocation = adUseClient
            .ConnectionTimeout = 0
            .CommandTimeout = 0
        End With
        If Err.Number = 0 Then
           MsgBox “Connection test succesfull”
           MsgBox “Connection failed.  “ & Err.Description
        End If
        Err.Number = 0 
    End Sub
    to err is human ; to really mess things up requires a computer

Posting Permissions

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