CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2001
    Location
    Barcelona-Spain
    Posts
    9

    Accessing MSAccess DB over Internet - Urgent

    I had developed an application that uses MSAccess, it works properly in a LAN, because you can share dirs and use those in ODBC connections. But the problem is that now, the app must use DBs over Internet. Is this possible?
    When I define .mdb file source, ODBC permits links http, ftp o shared resource, but this only generates a new link on win explorer, and this link is unuseable as source in the ODBC string (at least doing this with the wizard). I tried this, putting th .mdb in a dir in a Web (just to try one possibility to access the database file).

    Please, I need help urgently.


  2. #2
    Join Date
    Dec 1999
    Location
    Greece
    Posts
    75

    Re: Accessing MSAccess DB over Internet - Urgent

    Change the odbc driver to OLE Prodider
    And example connecting to a db is the following

    <%@ Language=VBScript %>
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <SCRIPT LANGUAGE=vbscript RUNAT=Server>
    Set Conn = Server.CreateObject("ADODB.Connection")
    Application("str")="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &_
    Server.MapPath("db2.mdb") & ";jet oledb:system database=" & Server.MapPath("secured.mdw") & ";User id=vafis;Password="
    Conn.Open Application("str")
    Response.Write conn.State

    </SCRIPT>

    </HEAD>
    <BODY>

    <P> </P>

    </BODY>
    </HTML>


  3. #3
    Join Date
    Aug 2001
    Location
    Barcelona-Spain
    Posts
    9

    Re: Accessing MSAccess DB over Internet - Urgent

    I'll try to map the idea to my VC++ app.
    Y suppose Server.MapPath, return the path, of this file, when the ASP is interpreted in the web server, I'm wrong? So I must change this to the server path of the .mdb file.
    I suppose the important thing is that now I use {Microsoft Access Driver (*.mdb)} and probably using OleDB it would work?

    Ok, I'll try right now, thanks.


  4. #4
    Join Date
    Dec 1999
    Location
    Greece
    Posts
    75

    Re: Accessing MSAccess DB over Internet - Urgent

    In Server.MapPath you declare the path of database
    in the virtual directory.
    If you have the IIS or pws on your own you can use
    odbc driver


  5. #5
    Join Date
    Aug 2001
    Location
    Barcelona-Spain
    Posts
    9

    Re: Accessing MSAccess DB over Internet - Urgent

    (I post a new reply but seem lost I will repeat it and add something)
    I thing I undertand what what try to show me. You are adding a new ODBC string ON THE SERVER (where the Access file is). That's ok?
    But now, how an application, using ODBC could find this .mdb on server?
    Because the client doesn't have the info necessary to do this.
    I mean, what info must use in the ODBC to refer a remote DB.
    I have explain now better?

    Thanks a lot to spend your time with this.


  6. #6
    Join Date
    Dec 1999
    Location
    Greece
    Posts
    75

    Re: Accessing MSAccess DB over Internet - Urgent

    if your you are the admin of IIS or PWS you can use the odbc driver using the alias name in the connection sting
    By contrast you should use OLE db defining the path of db


  7. #7
    Join Date
    Aug 2001
    Location
    Barcelona-Spain
    Posts
    9

    Re: Accessing MSAccess DB over Internet - Urgent

    I think we not arrive anyway.
    I think you must forget the server point of view.
    Try "to be" a client Application, not a IE o Netscape, a VC or VB app. How can you know how access the .mdb file in the remote machine, with IP xxx.xxx.xxx.xxx, if you only be able to refer a fisical .mdb file. Or probably I'm wrong and what you try to explain is that the client may use any method, that don't refer the .mdb? Is that possible? Because the db.OpenEx I think it would fail.




  8. #8
    Join Date
    Dec 1999
    Location
    Greece
    Posts
    75

    Re: Accessing MSAccess DB over Internet - Urgent

    This code located in an active server page (it is asp page) which run on the server.
    With the command response.write conn.state the server return (send) to client the state of the connection.
    If I.E shows 1 the the connection is open
    I think that helps


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured