...

View Full Version : Database Error, Help in the .asp file



cexsar
03-28-2007, 06:37 PM
Hi, i'm helping a friend to setup his website he does online sales, so when I tried to go to the store it send me this message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

D:\HOSTING\CEXSAR\SECURE\../includes/databaseFunctions.asp, line 18

And this is my databaseFuntions.asp (the 18th line is in red) file does anybody knows what could be wrong here:

<%
' Comersus Sophisticated Cart
' Comersus Open Technologies
' USA - 2005
' Open Source License can be found at documentation/readme.txt
' http://www.comersus.com
' Details: functions to open and close db connection using dsn less string
%>
<!--#include file="../includes/adovbs.inc"-->
<%

sub openDb()
if varType(connTemp)=0 or varType(connTemp)=1 then

' create the connection
set connTemp = server.createObject("adodb.connection")

connTemp.Open pDatabaseConnectionString

if err.number <> 0 then
response.redirect "comersus_supportError.asp?error="&Server.Urlencode("Error while opening DB read:"&Err.Description& "<br><br><b>Common solutions</b><br><br>1. Check that you haven't change default database path and name <br>2. Check that your web server has Access 97 or 2000 ODBC installed <br>3. Check that you have read, modify and delete permissions over database folder and database file <br>4. Open your database with Access program and select Repair Database option <br>5. Select other connection method like other connection string or DSN")
end if

end if
end sub

sub getFromDatabase(mySQL, rsTemp, scriptName)

call openDb()

set rsTemp = server.createObject("adodb.recordset")

' set locktype
rsTemp.lockType = adLockReadOnly

' set the cursor
rsTemp.cursorType = adOpenForwardOnly

rsTemp.open mySQL, connTemp

if err.number <> 0 then
response.redirect "comersus_supportError.asp?error="&Server.Urlencode("Error in " &scriptName& ", error: "&Err.Description& " - Err.Number:"&Err.number&" - SQL:"&mySQL)
end if

end sub

sub getFromDatabasePerPage(mySQL, rsTemp, scriptName)

call openDb()

set rsTemp = server.createObject("adodb.recordset")

rsTemp.cursorLocation = adUseClient
rsTemp.cacheSize = pNumPerPage

rsTemp.open mySQL, connTemp

if err.number <> 0 then
response.redirect "comersus_supportError.asp?error="&Server.Urlencode("Error in " &scriptName& ", error: "&Err.Description& " - Err.Number:"&Err.number&" - SQL:"&mySQL)
end if

end sub

sub getFromDatabaseSeek(mySQL, rsTemp, scriptName)

call openDb()

set rsTemp = server.createObject("adodb.recordset")
rsTemp.cursorType = 3
rsTemp.lockType = 3

rsTemp.Open mySQL, connTemp

if err.number <> 0 then
response.redirect "comersus_supportError.asp?error="&Server.Urlencode("Error in " &scriptName& ", error: "&Err.Description& " - Err.Number:"&Err.number&" - SQL:"&mySQL)
end if

end sub

sub updateDatabase(mySQL, rsTemp, scriptName)

call openDb()

set rsTemp=connTemp.execute(mySQL)

if err.number <> 0 then
response.redirect "comersus_supportError.asp?error="&Server.Urlencode("Update Error in " &scriptName& ", error: "&Err.Description& " - Err.Number:"&Err.number&" - SQL:"&mySQL)
end if

end sub


function closeDB()
on error resume next

rsTemp.close
set rsTemp = nothing
connTemp.close
set connTemp = nothing

end function

%>

If anyone could help me I'll appreciate.

Thanks in advance.

mehere
03-29-2007, 01:01 AM
what is pDatabaseConnectionString?

SSJ
03-29-2007, 09:51 AM
Try to response.write pDatabaseConnectionString and let me know what it is...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum