If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Help!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-03, 20:37
lslars31 lslars31 is offline
Registered User
 
Join Date: Jun 2003
Location: Minnesota
Posts: 61
Question 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
Reply With Quote
  #2 (permalink)  
Old 07-21-03, 03:48
ivon ivon is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On