|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
At work, I'm a Management Information person/ Small Systems Analyst at a UK University.
In my spare time, (and totally unrelated to work!) I am trying to set up a web site to gather information into a database. I have never previously done any web-based work. I considered going down the path of PHP and MySQL, but being already familiar with the Microsoft stable, have set myself up to use ASP.NET through Visual Studio.Net (Architect) on a Windows XP Pro platform. MS Access has always suited me for simple manipulation and analysis work - and so I have elected to use an Access database with my website. My Question: Would it be possible for someone with VS.NET experience to tell me how to set up an OleDbCOnnection Object to use the Server.MapPath function to find its datasource. The OleDbConnection object wizard insists on being given the full path to the database. This is fine on my development machine, but when I get around to deploying my site to the (3rd party) web server, not being party to server drive structures - I will have problems. My Web hosting company has suggested I use MapPath (but cannot tell me how..) This has frustrated my progress for a couple of weeks now and I would be very grateful for any help/guidance. Many thanks for taking the time to read this! Mill |
|
#2
|
||||
|
||||
|
Speaking from the ASP side of things (I'm sure it's almost identical in VS.NET), the mapPath method simply returns an absolute path when given a relative path.
varAbsPath = server.mapPath("lib/db/product.mdb") The value of varAbsPath would be, for example, "d:\inetput\wwwroot\bob_website\lib\db\products.mdb " |
|
#3
|
|||
|
|||
|
Many thanks Stumpy - you are of course absolutely correct.
Does anyone out there actually use VS.NET to produce ASP.NET web apps? I somehow need to get the result of the MapPath function into the connection string of my OleDbConnection. Am I missing something? I can't believe that this is so difficult.. ![]() |
|
#4
|
||||
|
||||
|
Yeah - you must be missing something :P
There's thousand of .NET primers/tutorials out there on the net these days, just google! http://www.fawcette.com/vsm/2002_07.../default_pf.asp - here's the first one i found! |
|
#5
|
|||
|
|||
|
They don't call me 'Junior Member' for nothing
![]() Thanks for the link. Plenty of food for thought in there for the coming weekend. (sad man!) |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > OleDbConnection and Server.MapPath |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|