Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003

    Unanswered: Connect to an Internet Database

    I wrote an VB Program to access to an Access database which store in a web server. When I use it in an intranet is no problem. But when i try to access the data use internet it said "Requested operation requires an OLE DB Session object, which is not supported by the current provider."

    The code is something like below:

    Public Function initConnection(tempIP As String)

    On Error Resume Next
    Dim db As String
    db = tempIP & "\wwwroot\CN\FDP\Cn.mdb"
    cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db & ";Mode=Share Deny None;OLE DB Services=2"
    cmd.ActiveConnection = cn
    initConnection = Err.Description
    End Function

    Public Function DetectIP() As Integer
    DetectIP = False
    If initConnection("\\") = "" Then
    IP = "\\")
    ElseIf initConnection("//616.6.32.108") = "" Then
    IP = "//616.6.32.108"
    displayMsg ("Can not establish Conection")
    Exit Function
    End If
    DetectIP = True
    End Function

  2. #2
    Join Date
    Mar 2004

    Re: Connect to an Internet Database

    If you don't know the path to the MDB (using VB)

    oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & App.Path & "\myDb.mdb;" & _
    "User Id=admin;" & _

    (This assumes the MDB is in the same directory where the application is running.)

    Otherwise, try this link it has a list of all possible Connection Strings including a section entitled "If MDB is located on a remote machine"

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

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