...

View Full Version : Database problem on Brinkster.



Mhtml
07-23-2002, 10:27 AM
Hi, I seem to have a problem with my poll on my website.
I got this error


Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x764 Thread 0x78c DBC 0xa3d7bfc Jet'.

/cubestudios/index.asp, line 170


here is my asp source

<!---POLL--->
<%
'POLL SCRIPT:
'Two varibles are passed into the db
'u_input is the value if the user entered a response to
'the vote/poll question....IP is the address of the user
u_input=request.form("u_input")
u_ip=request.servervariables("remote_addr")

' if the user did not enter anything in the poll on this visit
' then display the poll question and possible choices
if u_input = "" then
%>
<form method="post" action="<%= request.servervariables("script_name") %>">
<p>How would you rate my site? <br>
<input type="radio" value="1" name="u_input">
<font size="2">Excellent<br>
<input type="radio" value="2" name="u_input" checked >
Great<br>
<input type="radio" value="3" name="u_input">
Fair<br>
<input type="radio" value="4" name="u_input">
Bad</font><br>
<input type="image" border="0" name="imageField" src="images/pwshome_24.png" width="61" height="26">
<input type="image" src="images/pwshome_25.png" name="submit" width="63" height="26" >
</p>
</form>
<%
else
' if the user did input a choice on the vote/ballot
' check to see if their ip address is already in the db
accessdb="/db/mainpoll"
cn="driver={Microsoft Access Driver (*.mdb)};"
cn=cn & "dbq=" & server.mappath(accessdb)
set rs = server.createobject("ADODB.Recordset")
sql = "select ip from ballot where ip ='" & u_ip & "'"

rs.Open sql, cn
if rs.eof then
' if the user has not voted previously indicate it
been_here_before="No"
end if
rs.close

if been_here_before = "No" then
' Since the user has not voted previously their input
' their vote will be added to the db

sql = "insert into ballot (ip, selection" & u_input &") "
sql = sql & "values ('" & u_ip & "',1)"
rs.Open sql, cn
end if

'This will summerize and count the records in the db
sql= "select distinctrow sum(selection1) as sum_selection1, "
sql= sql & "sum(selection2) AS sum_selection2, sum(selection3) AS sum_selection3, "
sql= sql & "sum(selection4) AS sum_selection4, count(*) AS total_votes "
sql= sql & "FROM ballot;"
rs.Open sql, cn
total1=rs ("sum_selection1")
total2=rs ("sum_selection2")
total3=rs ("sum_selection3")
total4=rs ("sum_selection4")
count=rs ("total_votes")
%>
How would you rate my site? <br>
<font size="2">Excelent</font><img height="10" src="images/pollgrey_left.png"><img src="images/pollgrey_middle.png" height="10" width="<%= (total1/count)*100 %>"><img height="10" src="images/pollgrey_left.png">
<%= formatnumber((total1/count)*100,1) %><font size="2">%</font><br>
<font size="2"> Great</font><img height="10" src="images/pollgrey_left.png"><img src="images/pollgrey_middle.png" height="10" width="<%= (total2/count)*100 %>"><img height="10" src="images/pollgrey_left.png">
<%= formatnumber((total2/count)*100,1) %><font size="2">%</font><br>
<font size="2"> Fair</font><img height="10" src="images/pollgrey_left.png"><img src="images/pollgrey_middle.png" height="10" width="<%= (total3/count)*100 %>"><img height="10" src="images/pollgrey_left.png">
<%= formatnumber((total3/count)*100,1) %><font size="2">%</font><br>
<font size="2">Bad</font><img height="10" src="images/pollgrey_left.png"><img src="images/pollgrey_middle.png" height="10" width="<%= (total4/count)*100 %>"><img height="10" src="images/pollgrey_left.png">
<%= formatnumber((total4/count)*100,1) %><font size="2">%</font><br>
Total Votes: <%= formatnumber(count,0,0) %><br>
<% if been_here_before <> "No" then %>
<% else %>
<% end if %>
<br>
<%= u_ip %>
<% end if %>

Zvona
07-23-2002, 11:39 AM
I suggest you to either contact Brinkster's support, read FAQs or post to the Brinkster's own discussion forum. This would result more exact answers.

Personally, I'm having problems with Brinkster's db constantly. And when there're no problems, they're working slowly :(.

whammy
07-24-2002, 12:56 AM
I'd try a different connection string. I always had problems with connection strings giving me that error (that work anywhere else).

This may be a bit verbose, but this is one that they suggest in their FAQ (and you can shorten it if you want), and I know from experience that it works on brinkster:



Set Conn = Server.CreateObject("ADODB.Connection")
sConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
sMapPath = Server.MapPath("\")
sMapPath = Mid(sMapPath, 1, InStrRev(sMapPath,"\")-1) & "\database\databasename.mdb;" & _
"Persist Security Info=False;"
sConnString = sConnString & sMapPath
Conn.Open sConnString


Hope this helps. :)

Mhtml
07-24-2002, 06:23 AM
I'll try that whammy.

The thing that confuses me the most is the fact that the way that I was accessing my DB the other day was fine and it was working well, but now it doesn't.

I think I will change to a payed service where I know what I want to do will work and work well.

Any suggestions for a good cheap webhost? around $150.00 AU would be good.

Mhtml
07-24-2002, 07:40 AM
actually I have anothe prob with my page now I have changed that databse access code. it says that I need rs object.

whammy
07-25-2002, 12:58 AM
That sounds more like a scripting error. Can we see the lines in question? :)

Mhtml
07-26-2002, 08:01 AM
<%
'POLL SCRIPT:
'Two varibles are passed into the db
'u_input is the value if the user entered a response to
'the vote/poll question....IP is the address of the user
u_input=request.form("u_input")
u_ip=request.servervariables("remote_addr")

' if the user did not enter anything in the poll on this visit
' then display the poll question and possible choices
if u_input = "" then
%>
<form method="post" action="<%= request.servervariables("script_name") %>">
<p>How would you rate my site? <br>
<input type="radio" value="1" name="u_input">
<font size="2">Excellent<br>
<input type="radio" value="2" name="u_input" checked >
Great<br>
<input type="radio" value="3" name="u_input">
Fair<br>
<input type="radio" value="4" name="u_input">
Bad</font><br>
<input type="image" border="0" name="imageField" src="images/pwshome_24.png" width="61" height="26">
<input type="image" src="images/pwshome_25.png" name="submit" width="63" height="26" >
</p>
</form>
<%
else
' if the user did input a choice on the vote/ballot
' check to see if their ip address is already in the db
Set Conn = Server.CreateObject("ADODB.Connection")
sConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
sMapPath = Server.MapPath("db\mainpoll.mdb")
sMapPath = Mid(sMapPath, 1, InStrRev(sMapPath,"db\mainpoll.mdb")-1) & "\db\mainpoll.mdb;" & _
"Persist Security Info=False;"
sConnString = sConnString & sMapPath
Conn.Open sConnString
rs.Open sql, cn
if rs.eof then
' if the user has not voted previously indicate it
been_here_before="No"
end if
rs.close

if been_here_before = "No" then
' Since the user has not voted previously their input
' their vote will be added to the db

sql = "insert into ballot (ip, selection" & u_input &") "
sql = sql & "values ('" & u_ip & "',1)"
rs.Open sql, cn
end if

'This will summerize and count the records in the db
sql= "select distinctrow sum(selection1) as sum_selection1, "
sql= sql & "sum(selection2) AS sum_selection2, sum(selection3) AS sum_selection3, "
sql= sql & "sum(selection4) AS sum_selection4, count(*) AS total_votes "
sql= sql & "FROM ballot;"
rs.Open sql, cn
total1=rs ("sum_selection1")
total2=rs ("sum_selection2")
total3=rs ("sum_selection3")
total4=rs ("sum_selection4")
count=rs ("total_votes")
%>

whammy
07-27-2002, 12:28 AM
Yeah, I see the problem... you're saying

rs Open sql, cn

but it looks like you accidentally deleted that part of the code, i.e.:

set rs = server.createobject("ADODB.Recordset")
sql = "select ip from ballot where ip ='" & u_ip & "'"

so nothing is being opened.

Mhtml
07-27-2002, 03:57 AM
hmm...Ok. I've change that, but I have another question.
Where is a good place to learn to make connections with databases?:confused:

whammy
07-31-2002, 12:43 AM
Not too sure, I'd try http://www.4guysfromrolla.com or perhaps http://www.aspalliance.com - or do a search on google for ODBC, etc.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum