Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 12th, 2004, 07:23 AM
styrochem styrochem is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 styrochem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to styrochem Send a message via Yahoo to styrochem
Angry Code Problem

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.

Reply With Quote
  #2  
Old May 13th, 2004, 01:39 AM
Yeruhn's Avatar
Yeruhn Yeruhn is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Netherlands
Posts: 428 Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 16 h 35 m 27 sec
Reputation Power: 10
Change your datasource to the correct one.

Reply With Quote
  #3  
Old May 13th, 2004, 06:43 AM
styrochem styrochem is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 styrochem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to styrochem Send a message via Yahoo to styrochem
Angry No Go

I adjusted the database source and it still gives the same error.

Reply With Quote
  #4  
Old May 13th, 2004, 08:27 AM
Yeruhn's Avatar
Yeruhn Yeruhn is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Netherlands
Posts: 428 Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 16 h 35 m 27 sec
Reputation Power: 10
Have you used mappath() to use the correct physical path?
See e.g.: http://www.devasp.com/samples/datamappath.asp

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Code Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway