Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL/ASP Problem!

Status
Not open for further replies.

OTMC

Programmer
Aug 15, 2007
4
0
0
GB
Here is (obviously part of) my current code:

getinfo = "select ID,docfilename, doctitle, phase, member, doctype, active from " & documenttable

uname = session("username")

getinfo3 = "select ID,docfilename, doctitle, phase, member, doctype, active from " & documenttable & " where member = " & uname

if session("UserType") = "Admin" then
set rs = DB_editCmd.Execute(getinfo)
else

if session("UserType") = "User" then
set rs = DB_editCmd.Execute(getinfo3)
end if
end if

if rs.EOF and rs.BOF then

response.write "Empty Database"

else

<<<<----OUTPUT THE RECORDS---->>>>


I've tried so many options and none of them work! At the moment I get the

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

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

error. Other ways I've tried to get the coding working, it appears to work initially, but ignores the WHERE statement so just outputs everything like the first getinfo SQL statement. I know for sure the session variable has the username in, and if you hardcode "WHERE member = companyname" (where companyname is a name in the database) it works perfectly!



 
i don't do ASP but the member name needs quotes around it

you've got --

getinfo3 = "select ... where member = " & uname

you want --

getinfo3 = "select ... where member = [red]'[/red]" & uname & "[red]'[/red]"


r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top