Results 1 to 2 of 2

Thread: Help!!

  1. #1
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61

    Question Unanswered: Help!!

    Heres my code:
    Code:
    <%
    If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then
    	'Redirect to unathorised user page
    	Response.Redirect"unauthorised_user.asp"
    End If
    %>
    <font size="4">GoldFish Games News Admin</font>
    <br><a href="admin_main.asp"><b>Main</b></a>&nbsp-&nbsp
    <%
    'Dimension variables
    Dim adoCon
    Dim rs
    Dim strSQL
    
    strUserName = Request.Querystring("name")
    
    Set adoCon = Server.CreateObject("ADODB.Connection")
    
    adoCon.open = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=n1i2c3k4; DBQ=" & Server.MapPath("news.mdb")
    
    Set rs = Server.CreateObject("ADODB.Recordset")
    
    strSQL = "SELECT tblUsers.Level FROM tblUsers WHERE tblUsers.Username="" & strUserName & """
    
    rs.Open strSQL, adoCon
    
    if rs("Level") = 2 Then
    %>
    <a href="delete_user_page.asp?name=<% =strUserName %>">Delete User</a>&nbsp-&nbsp<a href="add_user_form.asp?name=<% =strUserName %>">Add User</a>&nbsp-&nbsp<a href="delete_news_page.asp?name=<% =strUserName %>">Delete News</a>&nbsp-&nbsp
    <%
    Else
    End if
    %>
    <a href="add_news_form.asp?name=<% =strUsername %>">Add News</a>
    &nbsp-&nbsp
    <a href="edit_news_page.asp?name=<% =strUsername %>">Edit News</a>
    &nbsp-&nbsp
    <hr>
    there is probly a lot of other errors but right now I get this error:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

    [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

    /gfgames/db/news/menu.asp, line 25

    Does anyone know what the problem is?

    --My database is in the right place and linked correctly
    Mr. Lars

  2. #2
    Join Date
    Nov 2002
    Posts
    272
    Looks like you used double quotes where you need single quotes:

    strSQL = "SELECT tblUsers.Level FROM tblUsers WHERE tblUsers.Username='" & strUserName & "'"

    will get the job done.

Posting Permissions

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