| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I downloaded a template for an employee directory that was created in Chargecode but I am receiveing the following error when I upload it to our intranet. Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /employee/Common.asp, line 25 The database is an MS Access DB and the location is: http://10.1.81.12/employee/database/empldr.mdb Here is the Common.asp file: What do I need to change? <!-- #INCLUDE FILE="adovbs.inc" --> <!-- #INCLUDE FILE="TemplateObj.asp" --> <% ' ' Filename: Common.asp ' Generated with CodeCharge 1.1.19 ' ASPTemplates.ccp build 5/9/2001 ' CRLF = chr(13) & chr(10) bDebug = false sAppPath = left(Request("PATH_TRANSLATED"), instrrev(Request("PATH_TRANSLATED"), "\")) sHeaderFileName = sAppPath & "Header.html" Set cn = Server.CreateObject("ADODB.Connection") 'Database connection string strConn = "Provider=MSDASQL.1;Persist Security Info=False;User ID=Admin;Data Source=database\empldir_MSAccess.mdb" strLogin = "Administrator" strPassword = "" cn.open strConn, strLogin, strPassword sub openrs(rs, sql) Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = adUseServer rs.Open sql, cn, adOpenForwardOnly, adLockReadOnly, adCmdText end sub function ToHTML(strValue) if IsNull(strValue) then ToHTML = "" else ToHTML = Server.HTMLEncode(strValue) end if end function function ToURL(strValue) if IsNull(strValue) then strValue = "" ToURL = Server.URLEncode(strValue) end function function GetValueHTML(rs, strFieldName) GetValueHTML = ToHTML(GetValue(rs, strFieldName)) end function function GetValue(rs, strFieldName) on error resume next if rs is nothing then GetValue = "" elseif (not rs.EOF) and (strFieldName <> "") then res = rs(strFieldName) if isnull(res) then res = "" end if GetValue = res else GetValue = "" end if if bDebug then response.write err.Description end function function GetParam(ParamName) if Request.QueryString(ParamName).Count > 0 then Param = Request.QueryString(ParamName) elseif Request.Form(ParamName).Count > 0 then Param = Request.Form(ParamName) else Param = "" end if if Param = "" then GetParam = Empty else GetParam = Param end if end function Function ToSQL(Value, sType) Param = Value if Param = "" then ToSQL = "Null" else if sType = "Number" then ToSQL = CDbl(Param) else ToSQL = "'" & Replace(Param, "'", "''") & "'" end if end if end function function DLookUp(Table, fName, sWhere) on error resume next Res = cn.execute("select " & fName & " from " & Table & " where " & sWhere).Fields(0).Value if IsNull(Res) then Res = "" DLookUp = Res end function function getCheckBoxValue(sVal, CheckedValue, UnCheckedValue, sType) if isempty(sVal) then if UnCheckedValue = "" then getCheckBoxValue = "Null" else if sType = "Number" then getCheckBoxValue = UnCheckedValue else getCheckBoxValue = "'" & Replace(UnCheckedValue, "'", "''") & "'" end if end if else if CheckedValue = "" then getCheckBoxValue = "Null" else if sType = "Number" then getCheckBoxValue = CheckedValue else getCheckBoxValue = "'" & Replace(CheckedValue, "'", "''") & "'" end if end if end if end function function getValFromLOV(sVal, aArr) sRes = "" if (ubound(aArr) mod 2) = 1 then for i = 0 to ubound(aArr) step 2 if cstr(sVal) = cstr(aArr(i)) then sRes = aArr(i+1) next end if getValFromLOV = sRes end function Function ProceedError() if cn.Errors.Count > 0 then ProceedError = cn.Errors(0).Description & " (" & cn.Errors(0).Source & ")" elseif not (Err.Description = "") then ProceedError = Err.Description else ProceedError = "" end if end Function function CheckSecurity(iLevel) if Session("UserID") = "" then response.redirect("Login.asp?QueryString=" & toURL(request.serverVariables("QUERY_STRING")) & "&ret_page=" & toURL(request.serverVariables("SCRIPT_NAME"))) else if CLng(Session("UserRights")) < CLng(iLevel) then response.redirect("Login.asp?QueryString=" & toURL(request.serverVariables("QUERY_STRING")) & "&ret_page=" & toURL(request.serverVariables("SCRIPT_NAME"))) End if end function %> Any help would be greatly appreciated. |
|
#2
|
||||
|
||||
|
Change your datasource to the correct one.
|
|
#3
|
|||
|
|||
|
I adjusted the database source and it still gives the same error.
|
|
#4
|
||||
|
||||
|
Have you used mappath() to use the correct physical path?
See e.g.: http://www.devasp.com/samples/datamappath.asp |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Code Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|