Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post

    Database problem on Brinkster.

    Hi, I seem to have a problem with my poll on my website.
    I got this error

    Code:
    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
    Code:
    <!---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 %>
    Omnis mico antequam dominus Spookster!

  • #2
    Regular Coder
    Join Date
    May 2002
    Location
    Helsinki, Finland
    Posts
    231
    Thanks
    0
    Thanked 1 Time in 1 Post
    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 .
    Zvona
    First Aid for
    Web Design

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:

    Code:
    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.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #4
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.
    Omnis mico antequam dominus Spookster!

  • #5
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    actually I have anothe prob with my page now I have changed that databse access code. it says that I need rs object.
    Omnis mico antequam dominus Spookster!

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That sounds more like a scripting error. Can we see the lines in question?
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #7
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Code:
    <%
    '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")
    %>
    Omnis mico antequam dominus Spookster!

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #9
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    hmm...Ok. I've change that, but I have another question.
    Where is a good place to learn to make connections with databases?
    Omnis mico antequam dominus Spookster!

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •