|
|
#1 | |
![]() Join Date: Mar 2009
Posts: 2
|
Hi everyone.
I wonder if someone can help me. I have designed an ASP web site using DW CS4 and I have a problem using Server.MapPath in the database connection string. The database is Access 2003. If i use a direct path in the connection string e.g. Code:
<%
// FileName="Connection_ado_conn_string.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="true"
// Catalog=""
// Schema=""
var MM_DatabaseSVBB_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:/inetpub/wwwroot/database/svbb.mdb"
%>
Code:
<%
// FileName="Connection_ado_conn_string.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="true"
// Catalog=""
// Schema=""
var MM_DatabaseSVBB_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="& Server.MapPath("/database/svbb.mdb")
%>
Quote:
HTML Code:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%> <%Session.LCID = 2057%> <!-- #include file="Connections/DatabaseSVBB.asp" --> <% var rsQueryAll10Days_cmd = Server.CreateObject ("ADODB.Command"); rsQueryAll10Days_cmd.ActiveConnection = MM_DatabaseSVBB_STRING; rsQueryAll10Days_cmd.CommandText = "SELECT * FROM QueryAll10days ORDER BY [Date], [Time] ASC"; rsQueryAll10Days_cmd.Prepared = true; var rsQueryAll10Days = rsQueryAll10Days_cmd.Execute(); var rsQueryAll10Days_numRows = 0; %> Thanks in anticipation PaulGT |
|
|
|
|
|
|
#2 |
![]() Join Date: Jan 2006
Location: Toronto-Canada
Posts: 444
|
Did you know that MapPath only works when the DB is on the same directory as the files you are working on? Also, password you database. I had nightmares with Access files being hacked by Pakistany hackers and some Other hooligans from Turkey. Also, validate forms and the whole works.
__________________
J. DW | FW | HTML | CSS | ASP | some PHP | Windows | Ubuntu |
|
|
|
|
|
#3 |
![]() Join Date: Mar 2009
Posts: 2
|
Hi
thanks for your response. I was beginning to wonder if anyone would. Your information is very useful. I will re-think my strategy. Paulgt |
|
|
|
|
|
#4 |
![]() Join Date: Jan 2006
Location: Toronto-Canada
Posts: 444
|
No problem. I have been absent from the forum for months now, but I'll be checking it more often. Let me know how it goes.
Cheers, Javier
__________________
J. DW | FW | HTML | CSS | ASP | some PHP | Windows | Ubuntu |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|