Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-28-2007, 06:37 PM   PM User | #1
cexsar
New to the CF scene

 
Join Date: Mar 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
cexsar is an unknown quantity at this point
Question Database Error, Help in the .asp file

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.

Last edited by cexsar; 03-28-2007 at 07:25 PM..
cexsar is offline   Reply With Quote
Old 03-29-2007, 01:01 AM   PM User | #2
mehere
Regular Coder

 
Join Date: Jan 2005
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
mehere is an unknown quantity at this point
what is pDatabaseConnectionString?
mehere is offline   Reply With Quote
Old 03-29-2007, 09:51 AM   PM User | #3
SSJ
Regular Coder

 
Join Date: Mar 2007
Posts: 230
Thanks: 0
Thanked 4 Times in 4 Posts
SSJ is an unknown quantity at this point
Try to response.write pDatabaseConnectionString and let me know what it is...
__________________
Best Joomla Design Agency India ||PSD to Joomla Template || Award Winning Web Design Company India
SSJ is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:55 PM.


Advertisement
Log in to turn off these ads.