Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 27th, 2002, 02:43 PM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
error when i launch my asp page.

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/execstaff/poll2003/showques.asp, line 7


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)

Page:
GET /execstaff/poll2003/showques.asp

is there someone out there that can help me on this script... PLEASE!!!

Reply With Quote
  #2  
Old December 27th, 2002, 03:06 PM
djxtension djxtension is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: somewhere in holland
Posts: 7 djxtension User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Have you set up a DSN or do u use a DSN-less connection?

It would be more useful for us if you put up the script u use, so we can help you.

But as I look at the error, it seems u are using a very wrong connection-string.

Reply With Quote
  #3  
Old December 27th, 2002, 03:16 PM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok here it is all of it...Please help me...and yes I used a dns connection....
Attached Files
File Type: zip poll2003.zip (15.1 KB, 350 views)

Reply With Quote
  #4  
Old December 27th, 2002, 04:50 PM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ok here is another problem i am getting
Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/execstaff/poll2003/showques.asp, line 46

my line 46 reads =wend

Reply With Quote
  #5  
Old December 27th, 2002, 05:38 PM
djxtension djxtension is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: somewhere in holland
Posts: 7 djxtension User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I think I've found your problem.

You are using a connection string for an Sql-server database, while you are using an Access-database.

If you use a DSN connection, try this as a connection-string:

strConnect = "DSN=yourdsn "

where you replace yourdsn with your connection-name.

I hope this works.

Good luck

Reply With Quote
  #6  
Old December 27th, 2002, 05:45 PM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I added the following and I am still getting the error. I dont know what can be....

<% dim conn, rs, strSQL, strConnect, action
action = Request.QueryString("action")
set conn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
strConnect = "PROVIDER=SQLOLEDB;UID=sa;PWD=gilgamesh;Data Source=mhsnet_sql;Initial Catalog=Intranet;"

strSQL = "Select * from question order by question;"

conn.Open strConnect
rs.CursorLocation = adUseClient
rs.Open strSQL,conn,adOpenForwardOnly,adLockReadOnly %>

while not rs.EOF
%>
<font face="Verdana" size="2" color="black">
<h2><%=rs.Fields(1).Value%></h2>
Rated: <%=ShowRating(rs.Fields(0).Value)%><br><br>
<b>Question:</b> <%=rs.Fields(2).Value%><br>
<b>Summary:</b> <%=rs.Fields(3).Value%><br>
<b>Category:</b> <%=FormatCurrency(rs.Fields(4).Value, 2)%><br>
</font>
<br>
<form name="frmRate<%=rs.Fields(0).value%>" action="rate.asp" method="post">
<input type="hidden" name="quesId" value="<%=rs.Fields(0).value%>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="black">
<font face="Verdana" size="1" color="white">

<% for i = 1 to 5
Response.Write "&nbsp;" & i & " <input name='rating' type='radio' value='" & i & "'> "
next %>
</font>
<input type="submit" value="Rate It!">
</td>
</tr>
</table>
</form>
<hr size="1" color="#08496B" NOSHADE>
<%
rs.MoveNext
wend%>

<%

function ShowRating(quesId)

const MIN_RATINGS_BEFORE_SHOW = 3

dim rs1
dim avgRating
dim avgWhole
dim decPart
dim decCalc
dim finalRating
dim altText

set rs1 = Server.CreateObject("ADODB.Recordset")

rs1.ActiveConnection = "ADODB.Connection"
rs1.Open "SELECT SUM(rating), COUNT(*) FROM rating WHERE quesId = " & quesId

if rs1.Fields(1) < MIN_RATINGS_BEFORE_SHOW then
'No ratings for this Ques just yet
Response.Write "[Ques not rated yet]"
else
'This Ques has ratings, let's display the average
avgRating = rs1.Fields(0).Value / rs1.Fields(1).Value

if Instr(1, CStr(avgRating), ".") > 0 then
'The average rating is a decimal, we need to either
'round the value up/down
avgWhole = Left(CStr(avgRating), Instr(1, CStr(avgRating), ".")-1)
decPart = Mid(CStr(avgRating), Instr(1, CStr(avgRating), ".")+1, 2)

if decPart <> "" then
'Work out whether or not we have to round this
'rating up or down

if CInt(decPart) >= 5 then
decCalc = .5
else
decCalc = 0
end if

finalRating = CInt(avgWhole) + CCur(decCalc)
else
finalRating = avgRating
end if
else
finalRating = avgRating
end if

'Setup the alt text for the images
altText = "Average visitor rating of " & finalRating & " out of 5"

for i = 1 to CInt(finalRating)
Response.Write "<img alt='" & altText & "' src='rating_on.gif'>"
next

if CInt(finalRating) <> finalRating then
'This Question has a .5 rating, such as 5.5
Response.Write "<img alt='" & altText & "' src='rating_half.gif'>"

for i = CInt(finalRating)+2 to 5
Response.Write "<img alt='" & altText & "' src='rating_off.gif'>"
next
else
for i = CInt(finalRating)+1 to 5
Response.Write "<img alt='" & altText & "' src='rating_off.gif'>"
next
end if
end if

end function
%>

Reply With Quote
  #7  
Old December 28th, 2002, 12:37 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
Remove the %> at the end of this line

rs.Open strSQL,conn,adOpenForwardOnly,adLockReadOnly %>

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > error when i launch my asp page.


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 5 hosted by Hostway
Stay green...Green IT