Ask a Question related to ASP Database, Design and Development.
-
Sean #1
Connection object
I have inherited the following code from an existing system login asp page in my company. I am connecting to the same database and have been told to use the same connection code from below because it works fine. Im unsure exactly which code to keep and which code to extract. A global.asa has been set up in my project so I don't need to worry about that. Can anyone help me please?
<
dim c
cn = "
if len(Request.form("submit1")) > 0 the
Set dbcn = server.CreateObject("ADODB.Connection"
set dbrs = server.CreateObject("ADODB.Recordset"
dbcn.open Application ("connectionString"
lsSQL = "SELECT * FROM Users WHERE UserName = '" & replace(Request.Form("UserName"),"'","'") & "' AND Password = '" & replace(Request.Form("Password"),"'","'") & "'
response.write lsSQ
dbrs.Open lsSQL, dbcn,
if dbrs.RecordCount > 0 the
'Succes
cn = "Welcome " & dbrs ("FirstName"
Session ("ValidUser") = "Yes
Response.Cookies("UserName") = dbrs ("UserName"
Response.Cookies("DeptID") = dbrs ("DeptID"
'Response.write Session ("UserName")& "-"& Session("DeptID"
'Response.en
Response.Redirect("Logon.asp"
els
'Failur
cn = "Error you are not a valid user!!
Session ("ValidUser") = "No
end i
end i
%>
Sean Guest
-
Remote Object - connection time out
I am using RemoteObject services as the communication protocol between my Flex Client and J2EE server (WebSphere). After sending a request from... -
CFOBJECT COM Object Connection Exception
Hello, I?m trying to connect to a NT service with one built in EXE server using CFMX 6.1 This object is always running I just need to connect... -
Can remote object use jdbc connection pool?
Hi, Can a remote object use a jdbc connection pool? Does it have access to the connection pools running on the application server? Thanks, ED -
Database Connection Object
1. Check out the microsoft application blocks - data access - http://support.microsoft.com/default.aspx?scid=kb;en-us;829028 2. Check out the... -
holding a connection object across several ASP pages
Hi. I am new to ASP. I need to create a "wizard" using a SQL 7 database that will display a few forms and collect data from the user. My initial... -
Adrian Forbes [ASP MVP] #2
Re: Connection object
> <%
Keep the above and you can alter your lsSQL var to run different SQL> dim cn
> cn = ""
> if len(Request.form("submit1")) > 0 then
>
> Set dbcn = server.CreateObject("ADODB.Connection")
> set dbrs = server.CreateObject("ADODB.Recordset")
>
> dbcn.open Application ("connectionString")
>
Now have code to process the results> lsSQL = "SELECT * FROM ...."
> response.write lsSQL
> dbrs.Open lsSQL, dbcn, 3
>
Only you should clear up after yourself too
dbrs.Close
set dbrs = nothing
dbcn.close
set dbcn = nothing
Adrian Forbes [ASP MVP] Guest



Reply With Quote

