Server.MapPath() Doesn't Work
I have to upload my senior project to the school's sytem. My asp pages are all in one directory so there is no directory structure. At home I just reference my database file as Code:
Server.MapPath("mydb.mdb")
But it won't work on the school's system saying it can't find the database file. I've tried "mydb.mdb" and ".mydb.mdb", but it still won't find it. I'm just wanting to make sure that, those are the only ways you can reference your db. I've sent and email to the admin, but he doesn't answer his emails. (What an admin!) I'll have to talk to him in person about it then. Suggestions till then?
View Replies
ADVERTISEMENT
I have a site with the directory structure like this:
wwwroot (where the default.asp and other pages sit)inc (where the includes are)login (where login pages are)otherDirs (where other pages are)datafiles (where database is)
I usually hard code the db connection path but want to use the MapPath now in case in the future my site moves servers (have been though that and having to manually change all db connection strings - Not Fun ) Code:
View Replies
View Related
I am using CDONTS to send mail to the user from my ASP application.
However, the code doenst works all the time. I am able to get mails but
nothing happnes most of the time. The code works maybe once in 20 tries.
What could be the reason?
View Replies
View Related
i posted earlier, and the response seemed to be there is
another dll i need to use the cdonts object, i used it
fine for awhile on my old setup, i upgraded to 2k3 and it
errors up as if cdonts isnt an object. So is there a dll
i need to have to use the cdonts object in iis 6 or do i
need to rewrite my code to use cdo? (if so, please provide
asp 3 example on how to send an email with recepient,
sender, body and subject)
View Replies
View Related
I have got a problem wit da FILESYSTEM in ASP coding. Before I use window 98 installing PWS. Everything works fine....
And now, I use Window XP professional ( Laplop ), everything is updated ( Service Pack, .NET component, ASP.net stuff...
All my ASP code with FileSystem which used to be properly ran cant be executed on my XP server.
There is no message error on da page, but the browser icon keeps spinning and da content is blank, it means u dont see anything happens. I wanna ensure dat all da code is right, cos it work properly with PSW and other servers. I even tested with a simple code, but It still doesnt work..... Code:
View Replies
View Related
I'm using SQL Server and I decided to convert one of the fields from nvarchar to ntext. The transition in the manager was all right, but my ASP pages wouldn't display the ntext and there is no error message. I use Code:
<%=rs("Text")%>
to display the ntext...and there is nothing.
View Replies
View Related
I have a database table with several records. Now I am filtering some data based on the "where" statement. If I run the query in analyzer then I get 20 rows. If I run the same query in asp and assign GetRows() to an array, then the array returns only 4. I am not sure if I am using the GetRows wrong. Here is a snipp of my code:
View Replies
View Related
If I have multiple websites on the same server,can I use the #include directive to reference include files elsewhere on the server? I tried this -
<!--#include file="C:InetpubvhostsATRAMEMBER.COMhttpdocsheader.asp" -->
But no dice...
View Replies
View Related
How do you use server.mappath to update a access database on a completely different computer? One of my websites needs to update a database on a completely different website. Code:
View Replies
View Related
Set objFile = objFSO.GetFile(Server.MapPath(strFileName))
this line brings up this error:
----------
Error Type:
Microsoft VBScript runtime (0x800A0035)
File not found
/Turbomaster/presupuesto_confirm.asp, line 67
------------
the variable strFileName is being read correctly..
View Replies
View Related
there is an image folder in my root directoty containing images. When I run the following code from a file located in root directory, the file gets deleted. But when I put the file in some other folder, it generates error FILE NOT FOUND.
aND YES, i'VE TRIED BOTH
fso.deletefile(server.mappath("Images/"&photo))
fso.deletefile(server.mappath("/Images/"&photo))
<%
dim fso
photo="902392.jpg"
set fso = Server.CreateObject("Scripting.FileSystemObject")
fso.deletefile(server.mappath("Images/"&photo))
%>
View Replies
View Related
I am running exactly the same ASP code on IIS 5.0 and IIS 6.0
I am calling Server.MapPath(), the parameter is a virtual path that includes a reference to a parent path ("Root/Files/../Config/"). 'Config' is a virtual directory under 'Root' which is also a virtual directory. 'Files' is a normal folder.
Under IIS 5.0, the path is correctly mapped to the local path of the 'Config' virtual directory.
Under IIS 6.0, the path gets mapped to "C:WebSiteRootFiles..Config", ignoring the 'Config' virtual directory mapping. Is there a special setting I should be aware of in IIS 6.0 to ensure correct
mapping of virtual paths?
View Replies
View Related
I just don't understand it and I know I must be over complicating things.
strCon= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("diary.mdb")
but then I create a new folder called for instance 'database' and move my diary.mdb into it(with full permissions), what do I change the server.mappath to?
View Replies
View Related
My web site has three folders:
htdocs
logs
private
I want to access an MS Access database in the 'private' directory from scripts within the 'htdocs' folder.
Part of my connection string reads:
Data Source=" & Server.MapPath("../private/test.mdb")
But the page returns the following error:
Could not find file '[my web site]htdocsest.mdb'
Why is it still looking in the 'htdocs' folder when my connection string points to the 'private folder?
View Replies
View Related
The Windows OS allows commas in file/folder names but if you try to call .Code:
Server.MapPath("/smith, john/")
your application will neatly halt and provide you with an error report.Other than telling your site/network users not to use commas as allowed in the OS what can the application designer do to avoid the error.I am sure a kludgey workaround is to scan for the comma, change the file/folder name to something safe then restore the name at the end. I don't think this is a safe way to do things though.
View Replies
View Related
Code:
<%=Server.MapPath(rsCurrImgs("nvcLinkPath"))%>
Gives a strange error. When I do it like this: rsCurrImgs("nvcLinkPath")it works fine. What can it be?
Quote: Error Source: NULL
Category: Server.MapPath()
Description: Invalid Path Character
Full Description: An invalid character was specified in the Path parameter for the MapPath method.
View Replies
View Related
if you have an address
/dir/wwwroot/andy
and you use
server.mappath("/dir/andy")
you recieve the physical path , i.e. c:.inetpub/wwwroot/dir/andy
is there a way of going the other way ie from a physical path to a virtual path?
View Replies
View Related
I'm trying to create a log file of users accessing my site. This I can do on the current server using server.mappath, but I can't figure out how to write to a file on a different server.
View Replies
View Related
I'm trying to use the server.mappath function on a web site hosted on win
2000 professional.
Is this feature not on win 2000 pro?
It simply produces 'page not found' Code:
View Replies
View Related
I need to use Server.Execute for dynamic includes. My files are located in different folders and what works for one doesn't work for another. I need to include the full path to the file because relative paths do not work. Can someone tell me how to do something like this:
Server.Execute(Server.MapPath("./") & "includessubnavigationdefault.asp")
I keep getting this error:
Invalid URL form or fully-qualified absolute URL was used. Use relative URLs.
The problem is I NEED to use relative URLs some how.
View Replies
View Related
I have an asp file that gathers info from a form and sends to the database. im now changing the location of the database from the root path. I think that because of this i cannot use Server.MapPath method of sending data.
Coudl someone please help me out and let me know how i would change the code? Im quite new to this as you could probably see. Code:
View Replies
View Related
Anyone know how i can add other webserver files using server.mappath?
View Replies
View Related
I just took up the task of learning ASP, done all the hello world stuff and then thought about the DB side of things and thought that a login system would be a nice place to start, so naturally I started with the registration page, and asp page to do the actual DB stuff, but it would seem I have a prob with Server.MapPath. So I edited my Register page to test and sure enough it doesn’t work, but it works when I make a page with just a .Write of the Server.MapPath Code:
View Replies
View Related
I have a project where multiple sites in separate folders use the same db. My dbconn include file is causing this error.
Server.MapPath() error 'ASP 0173 : 80004005'
Invalid Path Character
/rboggs/fu/fu021/assign6/includes/dbconn.asp, line 9
An invalid character was specified in the Path parameter for the MapPath method.
here is my code
[hightlight="ASP"]
<%
Dim cnnEXDB
I have no clue what is wrong here any help would be greatly appreciated
View Replies
View Related
In my root folder, there is a folder "Images". I need to check whether there is a file named 23.jpg in it or not. I am using the following code but it's returning false. The file is in the folder.
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
x="23.jpg"
If fs.FileExists(Server.Mappath("/Images/"&x)) = true Then
Response.Write("File Exists.")
Else
Response.Write("File Does Not Exists")
End If
set fs=nothing
%>
View Replies
View Related
I need to map a path to my database file automatically, if I move the application to a different direcotry level I still have to write part of the path to get the application to work.
Is there anyway I can translate the directory path and place inside the mappath function so I dont have to manually edit it?
cst = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" &
server.mappath("shopsmartnetworkcartcart.mdb")
View Replies
View Related
I need to use Server.Execute for dynamic includes. My files are located in different folders and what works for one doesn't work for another. I need to include the full path to the file because relative paths do not work. Can someone tell me how to do something like this:
Server.Execute(Server.MapPath("./") & "includessubnavigationdefault.asp")
I keep getting this error:
Invalid URL form or fully-qualified absolute URL was used. Use relative URLs.The problem is I NEED to use relative URLs some how.
View Replies
View Related
How to use server.mappath() parent folder correctly:
Server.MapPath("../test.asp")
View Replies
View Related
I have just changed host and I need to change my Server.MapPath to comply with my new host db folder . Currently I have my path set to
Server.MapPath("db/access.mdb")
but I need to move it back up a few folders so it is above the "www" folder in the new hosts specified db folder. How do I achieve this?
View Replies
View Related
How can I make the commented out code work ? (Its clear what I'm trying to do)
Set filecol = filesys.getfolder("D:/Files/Apps").files
'Set filecol = filesys.getfolder(server.mappath("testingpage/storage")).files
View Replies
View Related
If I run Server.MapPath("/") on my operational Internet server I get, correctly, the physical path to the directory my page is in (d:.......htdocs).
If I run Server.MapPath("/") on my intranet server, my localhost, I get c:inetpubwwwroot, but my webpages are NOT in this folder, they are in c:webtest.
How to I establish the correct physical root on my intranet server?
View Replies
View Related
How can I change a server.mappath back to the virtual path. I am creating a search function on my site and it search through the files on the server. I start with the server.mappath("/") and it searches through all the files just fine but the file path is displayed at d:sitefolderfile.asp. how can i change that path back to the virtual path (/folder/file.asp)?
View Replies
View Related
How can I pass the results of a form field submitted to this statement
below?
<%
Set MyFileObj = Server.CreateObject("Scripting.FileSystemObject")
'### This Works
'###Set MyTextFile = MyFileObj.OpenTextFile(Server.MapPath("body.txt"))
'### This Doesnt work
Set MyTextFile = MyFileObj.OpenTextFile(Server.MapPath(" &
request.form("MyFileName") & "))
WHILE NOT MyTextFile.AtEndOfStream
Response.Write(MyTextFile.ReadLine & Chr(10))
WEND
MyTextFile.Close
%>
View Replies
View Related