writting to already connected database

G

Guest

Hello I am having troubles figuring this out. I have a page with a login script. the login asp script opens a microsoft database a makes sure that the username and password submited by a form exsist and that they match. After that the users are allowed to enter the site. What I would like to do is after the script verifies that the username and password match have it write those values to a different table in the same database. The name of the table I want to write to is "logins" and the name of the column inside the table is "Logins". the reason I need this is I would like to keep track of who logs on and how often. I only need an example of how to set the first column to write after that I could figure how to write to different columns and add new variables to submit ,however, I am having trouble just getting the first step done. I am very new to asp and just trying to get a grasp on it. The script I am using can be seen on http://www.indywestwrestling.com/new.txt. thanks for any help or comments. John
 
A

Andrew Murray

first up I wouldn't call the table Logins AND the field within that table
Logins.....that would confuse you and probably the script as well.

for example Select * from Table LOGINS where %Login% LIKE <%Login%>

call the field name logged_users or something more descriptive.

(forgive the incorrect code syntax, but you get the idea....)

John said:
Hello I am having troubles figuring this out. I have a page with a login
script. the login asp script opens a microsoft database a makes sure that the
username and password submited by a form exsist and that they match. After that
the users are allowed to enter the site. What I would like to do is after the
script verifies that the username and password match have it write those values
to a different table in the same database. The name of the table I want to write
to is "logins" and the name of the column inside the table is "Logins". the
reason I need this is I would like to keep track of who logs on and how often. I
only need an example of how to set the first column to write after that I could
figure how to write to different columns and add new variables to submit
,however, I am having trouble just getting the first step done. I am very new to
asp and just trying to get a grasp on it. The script I am using can be seen on
http://www.indywestwrestling.com/new.txt. thanks for any help or comments. John
 
T

Thomas A. Rowe

You would never want to use LIKE in a login type query, you would always want an exact match so the
correct example would be:

Login = Request.Form("Login")

Select * from LOGINS where Login = '" & Login & "'

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top