Hi,
I can set up my database for asp without any problems but I need some help on 2 asp files. I do not know what to name my database or tables,fields. Can someone please help me. My site that it is on-http:www.tsigold.com
"Login.asp"
<%@LANGUAGE=“VBSCRIPT”%> <%
Dim myconnection__strUserID
myconnection__strUserID = “x”
if(Request.Form(“UserID”) <> “”) then myconnection__strUserID = Request.Form(“UserID”)
Dim myconnection__strPassword
myconnection__strPassword = “1”
if(Request.Form(“Password”) <> “”) then myconnection__strPassword = Request.Form(“Password”)
%> <%
set myconnection = Server.CreateObject(“ADODB.Recordset”)
myconnection.ActiveConnection =“dsn=k_FlashLogin;”
myconnection.Source = “SELECT * FROM Login WHERE UserID = '” + Replace(myconnection__strUserID, “’”, “’’”) + “’ AND Password = '” + Replace(myconnection__strPassword, “’”, “’’”) + “’”
myconnection.CursorType = 0
myconnection.CursorLocation = 2
myconnection.LockType = 3
myconnection.Open
myconnection_numRows = 0
%>
<% If myconnection__strUserID <> “x” Then
If Not myconnection.EOF Then
Response.Write “login=Granted”
else
Response.Write “login=Denied”
End If
End If
%>
"reg.asp"
<%
UserID = Request.Form(“UserID”)
Password = Request.Form(“Password”)
FirstName = Request.Form(“FirstName”)
LasName = Request.Form(“LastName”)
Email = Request.Form(“Email”)
AccessGroup = Request.Form(“AccessGroup”)
%>
<html>
<head>
<title>New Page 1</title>
<meta name=“GENERATOR” content=“Microsoft FrontPage 3.0”>
</head>
<body>
<table width=“100%” border=“1”>
<tr>
<td><b>UserID</b></td>
<td><b>Password</b></td>
<td><b>FirstName</b></td>
<td><b>LastName</b></td>
<td><b>Email</b></td>
<td><b>AccessGroup</b></td>
</tr>
<!–webbot bot=“DatabaseRegionStart” startspan
s-columnnames=“UserID,Password,FirstName,LastName,Email,AccessGroup”
s-connstring=“DSN=k_FlashLogin” s-password b-tableformat=“TRUE”
s-sql=“Insert Into Login (UserID, Password, FirstName, LastName, Email, AccessGroup) values (’%%UserID%%’,’%%Password%%’,’%%FirstName%%’, ‘%%LastName%%’, ‘%%Email%%’, ‘%%AccessGroup%%’)”
local_preview="<tr><td colspan=12 bgcolor="#FFFF00" align=“center” width=“100%”><font color="#000000"> Database Regions do not preview unless this page is fetched from a Web server using a web browser. The following table will display one row for each query result row when the page is fetched from a Web server.</td></tr>"
preview clientside s-DefaultFields
s-NoRecordsFound=“Your registration has been successful.” i-MaxRecords i-ScriptTimeout
tag=“BODY” --><%
’ Substitute in form parameters into the query string
fp_sQry = “Insert Into Login (UserID, Password, FirstName, LastName, Email, AccessGroup) values (’%%UserID%%’,’%%Password%%’,’%%FirstName%%’, ‘%%LastName%%’, ‘%%Email%%’, ‘%%AccessGroup%%’)”
fp_sDefault = “”
fp_sNoRecords = “Your registration has been successful.”
fp_iMaxRecords = 0
fp_iTimeout = 0
fp_iCurrent = 1
fp_fError = False
fp_bBlankField = False
If fp_iTimeout <> 0 Then Server.ScriptTimeout = fp_iTimeout
Do While (Not fp_fError) And (InStr(fp_iCurrent, fp_sQry, “%%”) <> 0)
’ found a opening quote, find the close quote
fp_iStart = InStr(fp_iCurrent, fp_sQry, “%%”)
fp_iEnd = InStr(fp_iStart + 2, fp_sQry, “%%”)
If fp_iEnd = 0 Then
fp_fError = True
Response.Write “<B>Database Region Error: mismatched parameter delimiters</B>”
Else
fp_sField = Mid(fp_sQry, fp_iStart + 2, fp_iEnd - fp_iStart - 2)
If Mid(fp_sField,1,1) = “%” Then
fp_sWildcard = “%”
fp_sField = Mid(fp_sField, 2)
Else
fp_sWildCard = “”
End If
fp_sValue = Request.Form(fp_sField)
’ if the named form field doesn’t exist, make a note of it
If (len(fp_sValue) = 0) Then
fp_iCurrentField = 1
fp_bFoundField = False
Do While (InStr(fp_iCurrentField, fp_sDefault, fp_sField) <> 0) _
And Not fp_bFoundField
fp_iCurrentField = InStr(fp_iCurrentField, fp_sDefault, fp_sField)
fp_iStartField = InStr(fp_iCurrentField, fp_sDefault, “=”)
If fp_iStartField = fp_iCurrentField + len(fp_sField) Then
fp_iEndField = InStr(fp_iCurrentField, fp_sDefault, “&”)
If (fp_iEndField = 0) Then fp_iEndField = len(fp_sDefault) + 1
fp_sValue = Mid(fp_sDefault, fp_iStartField+1, fp_iEndField-1)
fp_bFoundField = True
Else
fp_iCurrentField = fp_iCurrentField + len(fp_sField) - 1
End If
Loop
End If
’ this next finds the named form field value, and substitutes in
’ doubled single-quotes for all single quotes in the literal value
’ so that SQL doesn’t get confused by seeing unpaired single-quotes
If (Mid(fp_sQry, fp_iStart - 1, 1) = “”"") Then
fp_sValue = Replace(fp_sValue, “”"", “”"""")
ElseIf (Mid(fp_sQry, fp_iStart - 1, 1) = “’”) Then
fp_sValue = Replace(fp_sValue, “’”, “’’”)
ElseIf Not IsNumeric(fp_sValue) Then
fp_sValue = “”
End If
If (len(fp_sValue) = 0) Then fp_bBlankField = True
fp_sQry = Left(fp_sQry, fp_iStart - 1) + fp_sWildCard + fp_sValue + _
Right(fp_sQry, Len(fp_sQry) - fp_iEnd - 1)
’ Fixup the new current position to be after the substituted value
fp_iCurrent = fp_iStart + Len(fp_sValue) + Len(fp_sWildCard)
End If
Loop
If Not fp_fError Then
’ Use the connection string directly as entered from the wizard
On Error Resume Next
set fp_rs = CreateObject(“ADODB.Recordset”)
If fp_iMaxRecords <> 0 Then fp_rs.MaxRecords = fp_iMaxRecords
fp_rs.Open fp_sQry, “DSN=k_FlashLogin”
If Err.Description <> “” Then
Response.Write “<B>Database Error: " + Err.Description + “</B>”
if fp_bBlankField Then
Response.Write " One or more form fields were empty.”
End If
Else
’ Check for the no-record case
If fp_rs.EOF And fp_rs.BOF Then
Response.Write fp_sNoRecords
Else
’ Start a while loop to fetch each record in the result set
Do Until fp_rs.EOF
%>
<!–webbot bot=“DatabaseRegionStart” i-checksum=“43234” endspan -->
<tr>
<td><!–webbot bot=“DatabaseResultColumn” startspan
s-columnnames=“UserID,Password,FirstName,LastName,Email,AccessGroup” s-column=“UserID”
b-tableformat=“TRUE” clientside local_preview=“Database: UserID”
preview=“Database: UserID” --><%
If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then Response.Write CStr(fp_rs(“UserID”))
%>
<!–webbot bot=“DatabaseResultColumn” i-checksum=“24692”
endspan --> </td>
<td><!–webbot bot=“DatabaseResultColumn” startspan
s-columnnames=“UserID,Password,FirstName,LastName,Email,AccessGroup” s-column=“Password”
b-tableformat=“TRUE” clientside local_preview=“Database: Password”
preview=“Database: Password” --><%
If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then Response.Write CStr(fp_rs(“Password”))
%>
<!–webbot bot=“DatabaseResultColumn” i-checksum=“29488”
endspan --> </td>
<td><!–webbot bot=“DatabaseResultColumn” startspan
s-columnnames=“UserID,Password,FirstName,LastName,Email,AccessGroup” s-column=“FirstName”
b-tableformat=“TRUE” clientside local_preview=“Database: FirstName”
preview=“Database: FirstName” --><%
If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then Response.Write CStr(fp_rs(“FirstName”))
%>
<!–webbot bot=“DatabaseResultColumn”
i-checksum=“32411” endspan --> </td>
<td><!–webbot bot=“DatabaseResultColumn” startspan
s-columnnames=“UserID,Password,FirstName,LastName,Email,AccessGroup” s-column=“LastName”
b-tableformat=“TRUE” clientside local_preview=“Database: LastName”
preview=“Database: LastName” --><%
If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then Response.Write CStr(fp_rs(“LastName”))
%>
<!–webbot bot=“DatabaseResultColumn” i-checksum=“29199”
endspan --> </td>
<td><!–webbot bot=“DatabaseResultColumn” startspan
s-columnnames=“UserID,Password,FirstName,LastName,Email,AccessGroup” s-column=“Email”
b-tableformat=“TRUE” clientside local_preview=“Database: Email” preview=“Database: Email” --><%
If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then Response.Write CStr(fp_rs(“Email”))
%>
<!–webbot
bot=“DatabaseResultColumn” i-checksum=“23454” endspan --> </td>
<td><!–webbot bot=“DatabaseResultColumn” startspan
s-columnnames=“UserID,Password,FirstName,LastName,Email,AccessGroup”
s-column=“AccessGroup” b-tableformat=“TRUE” clientside
local_preview=“Database: AccessGroup” preview=“Database: AccessGroup” --><%
If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then Response.Write CStr(fp_rs(“AccessGroup”))
%>
<!–webbot
bot=“DatabaseResultColumn” i-checksum=“52422” endspan --> </td>
</tr>
<!–webbot bot=“DatabaseRegionEnd” startspan b-tableformat=“TRUE” local_preview preview
clientside tag=“BODY” --><%
’ Close the loop iterating records
fp_rs.MoveNext
Loop
End If
fp_rs.Close
’ Close the If condition checking for a connection error
End If
’ Close the If condition checking for a parse error when replacing form field params
End If
set fp_rs = Nothing
%>
<!–webbot bot=“DatabaseRegionEnd” i-checksum=“55813” endspan
–>
</table>
</body>
</html>