Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Ken_iversen #1
Virtual Path
Hi, I have an application with a connection.asp document linking to the MS
Access database Previously I have had the database ABOVE the ROOT and all was
working fine.. I have shifted the database BELOW the ROOT and I am tryin gto
get the virtual path right in the connection.asp document The inital code
datasourcename='Driver={Microsoft Access Driver (*.mdb)}; DBQ=' &
Server.MapPath('database/databasename.mdb') the physical path is (on the BELOW
database) d:\hshome\jimglass\database\databasename.mdb I have tried all the
combinations I thn possible... any IDEAS :) Thanks
Ken_iversen Guest
-
Jrun virtual-mapping to UNC path
Is it possible to set the <virtual-mapping><system-path> in the jrun-web.xml file to point to a UNC path? I want all of the .cfm files to reside... -
#26186 [Bgs]: include_path ignored using include with virtual path
ID: 26186 User updated by: jon at banton dot plus dot com Reported By: jon at banton dot plus dot com Status: Bogus... -
virtual path problem
hi, I have a script in a folder which simply creates a file in another dump folder /myscript/script.php /myscript/dumpfolder/ but then i... -
Virtual Path from a class Object
An object resides in memory. As such, there is no path, virtual or otherwise to it. -- HTH, Kevin Spencer Microsoft MVP ..Net Developer... -
Convert Physical path to Virtual path?
We have a field that gets filled into a database that our ASP website pulls from. What we would like to be able to do is to take that path and... -
CarlGrint #2
Re: Virtual Path
Instead of using Server Mappath you can simply create a version of your
connection file for the live site and use
d:\hshome\jimglass\database\databasename.mdb
Originally posted by: Ken_iversen
Hi, I have an application with a connection.asp document linking to the MS
Access database Previously I have had the database ABOVE the ROOT and all was
working fine.. I have shifted the database BELOW the ROOT and I am tryin gto
get the virtual path right in the connection.asp document The inital code
datasourcename="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("database/databasename.mdb") the physical path is (on the BELOW
database) d:\hshome\jimglass\database\databasename.mdb I have tried all the
combinations I thn possible... any IDEAS :) Thanks
CarlGrint Guest
-
Ken_iversen #3
Re: Virtual Path
Hi, Carl I did not write the application, but bougt the code as is.. so
needless to say, I am not an .asp programmer :) The entire application relies
on this connection.asp document, so I am not sure how to build my own
connection file to fit?? Do I simply change the statement within the existing
file? Cheers for your input anyway..
<%
'===============================================
' (C) 2004 Radiant Software, Inc. Version 2.4
' Email Contact: [email]Personals@TestPersonals.com[/email]
' Parts of this code were developed by Duware.com
'===============================================
' - EDIT BELOW -
'================================================= =======
'The system should work right out of the box the way it
'is setup here. Please keep in mind that this is a easy
'install but not very secure. Anyone who knows the
'location of your DB can download it and get the admin
'password. It is a good idea to move the DB to a folder
'that can not be accessed by the web or the IIS
'anonymous user.
'================================================= =======
'MS Access Connection String
'datasourcename="yourdsn"
'MS Access Connection String
datasourcename="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("database/personals24.mdb")
' - DO NOT EDIT BELOW -
if NOT request.cookies("rest") = "" then
id = request.cookies("rest")
response.redirect("restricted.asp?idd=") & id
end if
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 10
Response.Expires = -1000
Response.CacheControl = "no-cache"
'Dim pathtodatabase
Dim datasourcename
Dim DBtype
Dim cursortype
Dim MM_conn_STRING
Dim cmdTemp
Dim rs_main
Dim rs_main2
Dim rsSession
Dim rsSession_numRows
Dim rsSession__MMColParam
Dim rs125
Dim rs125_numRows
'-----------------------------------------------
'DATABASE CONNECTION SETTINGS
'-----------------------------------------------
Set MM_conn_STRING = Server.CreateObject("ADODB.Connection")
MM_conn_STRING.Open datasourcename
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set rs_main = Server.CreateObject("ADODB.Recordset")
Set rs_main2 = Server.CreateObject("ADODB.Recordset")
If (Session("MM_Username") <> "") Then
rsSession__MMColParam = Session("MM_Username")
set rsSession = Server.CreateObject("ADODB.Recordset")
rsSession.ActiveConnection = MM_conn_STRING
rsSession.Source = "SELECT * FROM users WHERE p_user = '" +
Replace(rsSession__MMColParam, "'", "''") + "'"
rsSession.CursorType = 0
rsSession.CursorLocation = 2
rsSession.LockType = 3
rsSession.Open()
rsSession_numRows = 0
If NOT rsSession.EOF And NOT rsSession.BOF AND NOT
IsNull(rsSession("p_ban")) Then
user = rsSession("p_user")
id = rsSession("p_id")
response.redirect("restricted.asp?uz=") & user & ("&id=") & id
end if
elseIf (ucase(Request.Cookies("id"))<> "$") AND
(ucase(Request.Cookies("access"))<> "") Then
Dim user_id
Dim user_pass
user_id=Request.Cookies("id")
user_pass=Request.Cookies("access")
set rsSession = Server.CreateObject("ADODB.Recordset")
rsSession.ActiveConnection = MM_conn_STRING
rsSession.Source = "SELECT * FROM users WHERE p_user = '" + Replace(user_id,
"'", "''") + "' AND p_password = '" + Replace(user_pass, "'", "''") + "'"
rsSession.CursorType = 0
rsSession.CursorLocation = 2
rsSession.LockType = 3
rsSession.Open()
rsSession_numRows = 0
If NOT rsSession.EOF And NOT rsSession.BOF AND NOT IsNull(rsSession("p_ban"))
Then
Session("MM_Username") = rsSession("p_user")
set rsupp = Server.CreateObject("ADODB.Command")
rsupp.ActiveConnection = MM_conn_STRING
rsupp.CommandText = "UPDATE p_users SET p_expdate = Now()+365 WHERE p_user =
'" + Replace(user_id, "'", "''") + "'"
rsupp.CommandType = 1
rsupp.CommandTimeout = 0
rsupp.Prepared = true
rsupp.Execute()
set rsupp = nothing
elseIf NOT rsSession.EOF And NOT rsSession.BOF AND NOT rsSession("p_ban") = ""
Then
user = rsSession("p_user")
id = rsSession("p_id")
response.redirect("restricted.asp?uz=") & user & ("&id=") & id
end if
else
rsSession__MMColParam = Session("MM_Username")
set rsSession = Server.CreateObject("ADODB.Recordset")
rsSession.ActiveConnection = MM_conn_STRING
rsSession.Source = "SELECT * FROM users WHERE p_access = 'nothing'"
rsSession.CursorType = 0
rsSession.CursorLocation = 2
rsSession.LockType = 3
rsSession.Open()
rsSession_numRows = 0
End If
%><%
'===============================================
' (C) 2004 Radiant Software, Inc. Version 2.4
' Email Contact: [email]Personals@TestPersonals.com[/email]
' Parts of this code were developed by Duware.com
'===============================================
' - EDIT BELOW -
'================================================= =======
'The system should work right out of the box the way it
'is setup here. Please keep in mind that this is a easy
'install but not very secure. Anyone who knows the
'location of your DB can download it and get the admin
'password. It is a good idea to move the DB to a folder
'that can not be accessed by the web or the IIS
'anonymous user.
'================================================= =======
'MS Access Connection String
'datasourcename="yourdsn"
'MS Access Connection String
datasourcename="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("database/personals24.mdb")
' - DO NOT EDIT BELOW -
if NOT request.cookies("rest") = "" then
id = request.cookies("rest")
response.redirect("restricted.asp?idd=") & id
end if
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 10
Response.Expires = -1000
Response.CacheControl = "no-cache"
'Dim pathtodatabase
Dim datasourcename
Dim DBtype
Dim cursortype
Dim MM_conn_STRING
Dim cmdTemp
Dim rs_main
Dim rs_main2
Dim rsSession
Dim rsSession_numRows
Dim rsSession__MMColParam
Dim rs125
Dim rs125_numRows
'-----------------------------------------------
'DATABASE CONNECTION SETTINGS
'-----------------------------------------------
Set MM_conn_STRING = Server.CreateObject("ADODB.Connection")
MM_conn_STRING.Open datasourcename
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set rs_main = Server.CreateObject("ADODB.Recordset")
Set rs_main2 = Server.CreateObject("ADODB.Recordset")
If (Session("MM_Username") <> "") Then
rsSession__MMColParam = Session("MM_Username")
set rsSession = Server.CreateObject("ADODB.Recordset")
rsSession.ActiveConnection = MM_conn_STRING
rsSession.Source = "SELECT * FROM users WHERE p_user = '" +
Replace(rsSession__MMColParam, "'", "''") + "'"
rsSession.CursorType = 0
rsSession.CursorLocation = 2
rsSession.LockType = 3
rsSession.Open()
rsSession_numRows = 0
If NOT rsSession.EOF And NOT rsSession.BOF AND NOT
IsNull(rsSession("p_ban")) Then
user = rsSession("p_user")
id = rsSession("p_id")
response.redirect("restricted.asp?uz=") & user & ("&id=") & id
end if
elseIf (ucase(Request.Cookies("id"))<> "$") AND
(ucase(Request.Cookies("access"))<> "") Then
Dim user_id
Dim user_pass
user_id=Request.Cookies("id")
user_pass=Request.Cookies("access")
set rsSession = Server.CreateObject("ADODB.Recordset")
rsSession.ActiveConnection = MM_conn_STRING
rsSession.Source = "SELECT * FROM users WHERE p_user = '" + Replace(user_id,
"'", "''") + "' AND p_password = '" + Replace(user_pass, "'", "''") + "'"
rsSession.CursorType = 0
rsSession.CursorLocation = 2
rsSession.LockType = 3
rsSession.Open()
rsSession_numRows = 0
If NOT rsSession.EOF And NOT rsSession.BOF AND NOT IsNull(rsSession("p_ban"))
Then
Session("MM_Username") = rsSession("p_user")
set rsupp = Server.CreateObject("ADODB.Command")
rsupp.ActiveConnection = MM_conn_STRING
rsupp.CommandText = "UPDATE p_users SET p_expdate = Now()+365 WHERE p_user =
'" + Replace(user_id, "'", "''") + "'"
rsupp.CommandType = 1
rsupp.CommandTimeout = 0
rsupp.Prepared = true
rsupp.Execute()
set rsupp = nothing
elseIf NOT rsSession.EOF And NOT rsSession.BOF AND NOT rsSession("p_ban") = ""
Then
user = rsSession("p_user")
id = rsSession("p_id")
response.redirect("restricted.asp?uz=") & user & ("&id=") & id
end if
else
rsSession__MMColParam = Session("MM_Username")
set rsSession = Server.CreateObject("ADODB.Recordset")
rsSession.ActiveConnection = MM_conn_STRING
rsSession.Source = "SELECT * FROM users WHERE p_access = 'nothing'"
rsSession.CursorType = 0
rsSession.CursorLocation = 2
rsSession.LockType = 3
rsSession.Open()
rsSession_numRows = 0
End If
%>
Ken_iversen Guest
-
CarlGrint #4
Re: Virtual Path
have you tried..?
& Server.MapPath("jimglass/database/databasename.mdb")
CarlGrint Guest
-
Ken_iversen #5
Re: Virtual Path
Hi, Carl Yes, I think I have tried every possible combination of the path :)
Your suggestion takes the error to line 55 where is calls to 'open' the
database Here is the message I get... Mate, thanks for your patience on this...
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC
Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the
path name is spelled correctly and that you are connected to the server on
which the file resides. /man-ads/connection/connection.asp, line 55
Ken_iversen Guest



Reply With Quote

