Forums

This topic is locked

where to put my database on the remote server?

Posted 10 Feb 2003 14:42:20
1
has voted
10 Feb 2003 14:42:20 Andy G posted:
Hey,

After finishing my first little ultradev project I want to upload everything on the remote server.
I used IIS as a local server and it worked fine,my mdb database was located on my c: drive.
But where do I put my database itself on the remote server, I mean my *.mdb file?
Should I change my connections file?

thx !!

Andy

Replies

Replied 10 Feb 2003 15:22:51
10 Feb 2003 15:22:51 Mitchel Tendler replied:
I believe different hosting companies have different requirements, my hosting company creates a folder on the SAME level as the html folder and that is where they go.

Ask your hosting company.
Replied 10 Feb 2003 16:36:32
10 Feb 2003 16:36:32 Julio Taylor replied:
you're going to need a host who can make DSN connection strings for you, arent you? is your host a Win2kserver with DSN support?

------------------------
Julio

PHP | MySQL | DWMX | ColdFusion

ICQ: 19735247
Replied 10 Feb 2003 16:54:18
10 Feb 2003 16:54:18 Andy G replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
you're going to need a host who can make DSN connection strings for you, arent you? is your host a Win2kserver with DSN support?
---&gt; So my provider has to make the dns connection to my mdb file??

Can you explain this a little more?

thx !

------------------------
Julio

PHP | MySQL | DWMX | ColdFusion

ICQ: 19735247
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 10 Feb 2003 17:23:44
10 Feb 2003 17:23:44 Stefan P replied:
Usually hosting companies suggest using a 'private' folder that they set up.
Provided you are using a DSN it doesn't really matter where you put the DB. The connections will reamin the same!

DMX | ASP | VBScript | ACCESS | IIS5
Replied 11 Feb 2003 11:55:38
11 Feb 2003 11:55:38 Julio Taylor replied:
when you use an Access database, you usually need to specify DSN connections through the ODBC dialog in the control panel. You will also need to do this in your host if you want to use a database in a remote server. If your hosts does not provide DSN connections (it may be a UNIX server), the only way to connect to an access database is to create a DSN-less connection string (which is a bastard pain in the ass). i have no idea how to do this. in this case you might want to start thinking about changing to an adult database like MSQL, MySQL, Postgre or Oracle.

cheers!

------------------------
Julio

PHP | MySQL | DWMX | ColdFusion

ICQ: 19735247
Replied 11 Feb 2003 12:45:38
11 Feb 2003 12:45:38 Owen Eastwick replied:
DON'T USE DSN's

DSN's are old hat.

Use an OLE DB connection, here's how to set one up: www.tdsf.co.uk/tdsfdemo/Tutorial05.htm

Now when you upload your files and the database to the host, your connection will not work, because if you set it up locally it will be using the local dirctory structure for your local database.

To determine the directory structure and the location of the *.mdb file at the remote host use server.mappath:

Create a simple page:

&lt;%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%&gt;
&lt;html&gt;
&lt;body&gt;
&lt;%= Response.Write(Server.MapPath("/SomeDirectory/YourDatabase.mdb") %&gt;
&lt;/body&gt;
&lt;/html&gt;


Upload it to your web space, now navigate to it in your browser, the page should look something like this:

C:\WebsiteDirectory\www.YourDomain.com\YourDataBaseDirectory\YourDataBaseName.mdb


Now look in the Connections folder at the REMOTE host and open the YourConnection.asp page, it will look something like this:

&lt;%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_con_objects_STRING
MM_con_objects_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\SomeLocalDirectory\DataBaseDirectory\YourDatabasName.mdb;Persist Security Info=False"
%&gt;

To modify the connection string so that it works at the remmote host simply modify the
<b>Data Source=</b> part to the directory structure returned by the Server.Mappath page, so it would look like this:

&lt;%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_con_objects_STRING
MM_con_objects_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\WebsiteDirectory\www.YourDomain.com\YourDataBaseDirectory\YourDataBaseName.mdb;Persist Security Info=False"
%&gt;

That's it, your pages will naow work at the remote host.

So, using OLE DB, you don't have to set up a DSN, either locally or at the remote host, so you don't have to wait for the host to do it for you, or muck about in the control panel. Also using OLE DB you can set up as many databases and connections at the remote host as you can fit in your web space, even if your host plan limits the number of DSN's you can have.

Regards

Owen.

-------------------------------------------------------------------------------------------
Used programming books and web development software for sale (UK only):
www.tdsf.co.uk/tdsfdemo/Shop.htm


Multiple Parameter UD4 / Access 2000 Search Tutorial:
www.tdsf.co.uk/tdsfdemo/

Edited by - oeastwick on 11 Feb 2003 12:49:34
Replied 21 Feb 2003 00:45:41
21 Feb 2003 00:45:41 Mark Taylor replied:
Andy, When you set up a connection locally on your PC your local connection probably looks something like this:

%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
MM_andy_STRING = "dsn=andydsn;"
%&gt;

My web host tried to charge me £20 to set up a DSN-Less connection so I just went and found out how to do it myself by reading forum posts. It's not hard at all and instead of the above connection file, it will be something like:

&lt;%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_andy_STRING
MM_andy_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=e:\123\andy\andydb.mdb"
%&gt;

You'll have to ask your webhost what the equivalent path (e:\123\andy) is for your site
I put my .asp files and my Access database in this e:\123\andy directory but I've seen other posts suggesting that you should put your database in a separate directory (not the root one) from a security point of view. Presumably if you put it in a folder
e:\123\andy\andysdb then the connection string above would just need \andysdb tagged on to the end

Hope this helps, Mark

Reply to this topic