Click to See Complete Forum and Search --> : Accessing MSAccess DB over Internet - Urgent
DaniFB
October 23rd, 2001, 06:11 AM
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.
Vafis
October 23rd, 2001, 06:49 AM
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>
DaniFB
October 23rd, 2001, 06:54 AM
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.
Vafis
October 23rd, 2001, 07:02 AM
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
DaniFB
October 23rd, 2001, 07:09 AM
(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.
Vafis
October 23rd, 2001, 07:17 AM
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
DaniFB
October 23rd, 2001, 07:26 AM
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.
Vafis
October 23rd, 2001, 07:35 AM
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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.