Re: Access trouble..

Re: Access trouble..

am 16.02.2005 14:29:36 von nntp

"Dan" wrote in message
news:11158fto8e7h0aa@corp.supernews.com...
> Can't seem to see what I'm doing wrong here..
>
> I have attached the three files that I am using... When i run
> default.asp in ie, i get the message
>
> ---------------------------------------------------
> Microsoft JET Database Engine (0x80040E10)
> No value given for one or more required parameters.
> /Phone/admin/login.inc, line 16
> ---------------------------------------------------
>
> I cant seem to figure out what i broke... I had this working before..
> Please note that strConnString is defined in adoArgs.inc not login.inc.
>
> I am new to asp, so I'm having trouble figuring out who to troubleshoot
> this. I usually use perl. In that case I would have it print out the
> variables in question then exit before the place were it brakes.. How
> can i do this in asp?? specifically how can i get it to exit before the
> error occurs??
>
>
> Thank you
>


------------------------------------------------------------ ----------------
----


> <%
>
>
>
> if len(session("user")) >0 or len(session("pass")) > 0 then
>
> ' identify data source
> Set DBConn = Server.CreateObject("ADODB.Connection")
> DBConn.Open strConnString
>
> 'Setup the recordset object & make sql statement
> Set rstListing = Server.CreateObject("ADODB.Recordset")
> strSQL = "SELECT Name,passwd,AlterAdmin FROM Admins WHERE login = '" &
session("user") & "' and passwd = '" & session("pass") & "';"
> 'response.write(strSQL)
>
> rstListing.Open strSQL, DBConn,adOpenForwardOnly,adLockReadOnly
>
> if rstlisting.BOF or rstlisting.EOF then
> session("LoggedIn") = "FAIL"
> else
> if session("pass") = rstlisting("passwd") then
> session("LoggedIn") = "YES"
> session("alteradmin") = rstlisting("AlterAdmin")
> else
> session("LoggedIn") = "FAIL"
> end if
> end if
>
>
> else
> session("LoggedIn")="NO"
> end if
>
>
>
> %>


------------------------------------------------------------ ----------------
----


> <%@ Language=VBScript %>
> <% ' PHONE BOOK ADMIN PAGE
>
>
> if session("LoggedIn") = "YES" then
> session.Abandon
> ' This is needed. with this removed the login page will
> ' allow you to login no matter what you have typed in
> ' if someone else has had a valid session.
> end if
>
> session("user")=request.form("user")
> session("pass")=request.form("pass")
>
> %>
>
>
> <%
> if session("LoggedIn") = "YES" then
> ' A new login.
> Response.Redirect("main.asp")
> end if
> %>
>
>
>
> Phonebook Administrator
>
>
>
>
>
>

bgcolor="#999999" align="center">
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
border="0">
height="57" border="0"> height="24"> height="57" border="0">
border="0">
border="0"> border="0" cellspacing="0" cellpadding="0">
>
>
>
> <% if session("LoggedIn") = "FAIL" then
> Response.Write("")
> session.Abandon
> else
> 'Response.Write("LOG=" & session("LoggedIn"))
> end if
> %>
>
Please login to access the Administration panel
INVALID USERNAME OR
PASSWORD!

>

 


>

> cellspacing="0">
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Username:

> " />
>
Password:

>
>


>
>
>


>

>

>
border="0">
border="0">
 

>
>


------------------------------------------------------------ ----------------
----


> <%
>
> const DBLOCATION = "\Phone\db\MPCphonebook.mdb"
> const DBPASS = "Qwerty"
>
> ' --------- No need to edit below this -----------
> const adOpenForwardOnly = 0
> const adOpenKeyset = 1
> const adOpenDynamic = 2
> const adOpenStatic = 3
>
> const adLockReadOnly = 1
> const adLockPessimistic = 2
> const adLockOptimistic = 3
>
> const adCmdText = 1
> const adCmdTable = 2
> const adCmdStoredProc = 4
> const adCmdUnknown = 8
> const adCmdTableDirect = 512
>
> public strConnString
> strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
> server.MapPath(DBLOCATION) & ";Jet OLEDB:Database Password=" &
DBPASS & ";"
>
> %>




Sorry about this... ms couldn't just say there was a problem w/ the sql
statement like every other language does...
I actually figured this out earlier, but didn't respond. I had forgotten
that i renamed one of the fields. For some reason the computer i was on
isn't showing this post, and therefore thought it didn't go through..


Thanks though.