PDA

View Full Version : ASP Connection to Access via ISP 1&1 How does it work?


djmarkymark
02-21-2008, 06:53 PM
Maybe Im missing the plot, or probably just stupid!
Every tutorial in the world shows how to set up dreamweaver to build .asp pages connecting to an MS Access database for dynamic pages! They show how to put files in wwwroot, and use IIS etc...
And how great they are because it works perfect on my computer... the one issue no tutorial or expert explains is, once the site is tested and running, how do you upload it to your Internet Service Provider!!!!
Because when I do that, it does not work!!!
Apparently you have to change codes dsn-less connection, asp scripts etc...
Its driving me nuts!

My dreamweaver site define is Local C:\inetpub\wwwroot\mysite
Remote: ftp to my host
Testing server: as per local
My database connection is dsn thru ODBC, Im able to create recordsets and populate pages with the correct fields to display dynamically. All works perfect on my computer!

Have I done something wrong in defining my site? Do I just upload my entire root folder with everything to my 1&1 host - When I do this, the dynamic stuff doesn't work. I guess its something to do with the connection string etc...
Please any help on what I need to change.. ALSO, if I do change the connection string so it works on the web, won't that stop it working on my PC?
I guess all this is not easy because not one tutorial on the entire web explains this "uploading" part clearly or at all!!!

Any good books etc.. or can some one help.

mangofreak
02-22-2008, 03:14 AM
djmarkymark,
1st. what many manuals don't mention is that (this is my experience) to avoid any problems deploying your site is good to have similar settings locally and on your live server.

I don't like odbc connections, because many times you have to go trhough the webhost to set them up and sometimes there are limts as to how many connections you can have. So I use DSN-less connections.

examples:
your connection search: connMyConnection
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\sitefolder\database\mydatabase.mdb;"

As you can the above connection points to the actual physical location of the database is in: Drive D, inside sitefolder (can be called anything that contains your files), inside the database folder, and the access file is called mydatabas.mdb

another way to connect to the server is by using:
"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/your_site/database/mydatabase.mdb") & ";"

This method only works if your database folder is in the root directory. Some providers have the database folder outside the root or public directory.

Ok. the meat of all this:
In my local machine I have 2 copies of my sites. one is development and one is live. Why? becasue I can keep track of things and test before I deploy.

If you feel brave, you can have only one.

In my development site: I use the same settings as in my live site. connection name, say: connMySite
Connection string: Using any of the above methods. then test.

The reason behind is that when you need to upload your files, you don't need to change anything. The only thing you would need to occassionally download is a fresh copy of your Access file to compact and repair from time to time, to keep it running smoothly.

To conclude here is a great tutorial:
http://www.ultradevguru.com/tutorial/dsnless.htm

Cheers. :D

djmarkymark
02-23-2008, 10:06 AM
Many thanks for that explaination, I think I've got it! Sorry for being so dumb.
So one of my sites would be in dreamweaver:
Local Info box: Local Root: C:\inetpub\MySite
Remote Info box: FTP pointing to my isp etc...
Testing Server box: As Local Root (using IIS on my own machine)
All this works fine on my own machine...

You say have another site set up live:
Would it be like this, or am I on the wrong lines:
Local info box: Local root: C:\inetpub\MySite
Remote info box: FTP to my isp
Testing server: Ftp (same settings as remote box)

Or does the local info box point at the remote isp server as well????
Sorry for being dim!!!
Im on Dreamweaver CS3

Thanks again
Mark

mangofreak
02-24-2008, 02:02 AM
Close, but not quite.

local copy would be on your C:\MySite

Testing and remote would be on your C:\Inetpub\Mysite
When you work in DW, you would upload all the files from C:\Mysite to you remote host: C:\Inetpub\Mysite

Now, using DW and upload a file called default.html

you can test it by going to:
http://localhost/Mysite/

As you can see, we are almost pretending that your Inetpub is the live server that you will be posting your files to.