Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 14th, 2005, 01:54 PM
dig dig is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 2 dig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 17 sec
Reputation Power: 0
Comparing MSSQL data with request.form

Hi Gurus - I do need a good help from You:
1 - I use Windows 2000 Server, MSSQL 2000, building the site (in .ASP) "www.contratosonline.com.br", for writing-yourself-Contracts on line.
2 - In pages like "http://www.contratosonline.com.br/contratos/aditamentoloc/1190aditamentoloc.asp", there's the code:
"Nome de Usuário ("username") <INPUT class="input" type=text name="username" id="username" size=15 maxLength=50 onfocus="style.backgroundColor='#E6E8FA'; style.color='#8E236B'" onblur="style.backgroundColor='#FFFFFF'; style.color='#000088'">" -- and another similar input for 'name="password".

3 - this form, method="POST", must take those 02 data to the (hidden) page "check1190.asp", where they will be compared with the "name" and "password" of the table "Members" of the MSSQL DB "Members", that's to say, to "allow" their access; the code is:
"<%@ LANGUAGE = "VBScript"
ENABLESESSIONSTATE = False %>
<% Option Explicit %>
<!-- #include virtual="../../inc/inc-conexao.asp"-->
<!-- #include virtual="../../inc/adovbs.inc"-->
<%
Dim username, name, password, tabelatitulo, contratonome
username=Request.Form("username")
password=Request.Form("password")

Dim objConn, objRS, rs, strSQL, id, strConnection
Call abre_objConn 'abre means open

Set objRS = Server.CreateObject("ADODB.Recordset")
Set objRS.ActiveConnection = objConn
strSQL="SELECT Members.name, Members.password FROM Members WHERE name = '" & username & "' AND password = '" & password & "'"
objRS.Open strSQL

While Not objRS.EOF
tabelatitulo="aditamentoloc"
contratonome=request.Form("contratonome")
' Criate the cookies
response.cookies("remain")=username
response.cookies("still")=password
response.cookies("idtabela")=tabelatitulo
response.cookies("idcontrato")=contratonome

If Request.Form("username")=objRS("name") AND Request.Form("password")=objRS("password") AND Request.Form("contratonome")<>"" Then
Response.redirect("../../contratos/aditamentoloc/aut1190.asp")
Else....."

4 - In that page, the configuration of the connection is made with an include file ("inc-conexao.asp") with this code:
"<%
sub abre_objConn ' abre means open
Set objConn = Server.CreateObject("ADODB.Connection")
strConnection = "Driver={SQL Server};SERVER=sql.rjnet.com.br;UID=XXX;PWD=XXX;DA TABASE=XXX"
objConn.Open strConnection
end sub
sub fecha_objConn ' fecha means close
objConn.close
Set objConn = Nothing
end sub
%>".

5 - IF the User is already registered, his/her data go to the page "aut1190.asp" where this request and the data will be included in the tables with the data of this new Contract that will be written, built.
6 - The "hell" is that, when I run the program -- using, of course, the name+password of a (registered) PATTERN-User, the program alerts me that... "It was not possible to autenticate the data of the User or of the password.....". ??!????!@#*&@?
Thaks a lot, in advance, for your kind help!
Dalton, Rio de Janeiro

Last edited by dig : April 14th, 2005 at 02:04 PM. Reason: Correcting same bad explanation. Sorry!

Reply With Quote
  #2  
Old April 25th, 2005, 03:23 PM
dig dig is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 2 dig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 17 sec
Reputation Power: 0
Already solved the problem.
Thaks a lot, anyway, for your kind help!
Dalton, Rio de Janeiro

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Comparing MSSQL data with request.form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT