# Flash+ASP+SQL Problem

**URL:** <https://forum.kirupa.com/t/flash-asp-sql-problem/140493>\
**Category:** Uncategorized\
**Created:** [March 11, 2005, 1:14pm UTC](https://forum.kirupa.com/t/flash-asp-sql-problem/140493 "2005-03-11T13:14:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![atulp](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@atulp](https://forum.kirupa.com/u/atulp)\
**Post date:** [March 11, 2005, 1:14pm UTC](https://forum.kirupa.com/t/flash-asp-sql-problem/140493/1 "2005-03-11T13:14:18Z")

</div>

Hi,

I have to connect flash to database as SQL. For that I have used ASP as middleware.  
I am able acces my data through ASP that means there is no problem with ASP-\>SQL connection.

Now my problem is if I am passing login name and password from swf to ASP and then checking in SQL database. I am not getting the output I want.

In my SWF there are two fields  
1)Login:uname  
2)Password:pword  
3)Button:go\_btn

On frame 1 I’ve written the code as:

## login.swf

## //function to check the login stop(); function doLogin() { var sendLogin:LoadVars = new LoadVars(); sendLogin.uname = \_root.uname.text; sendLogin.pword = \_root.pword.text; var logInReply:LoadVars = new LoadVars(); logInReply.onLoad = function(success) { if (successs) { if (logInReply.answer=“ok”) { //“status” is the instance name of the status text box \_root.status1.text = “Login Successful”; } else { \_root.status1.text = “Login Failed”; } } }; sendLogin.sendAndLoad(“login1.asp”, logInReply, “POST”); } \_root.go\_btn.onRelease = doLogin;

## And in ASP page I have written code as:

\<%@ Language=VBScript %\>  
\<!–#include file=“adovbs.inc” --\>  
\<%  
Dim strUsername  
Dim Pwd  
response.write(“login”)  
strUsername = Request.form(“uname”)  
Pwd = Request.form(“pword”)  
Set conn = Server.CreateObject(“ADODB.Connection”)  
conn.Open “Driver={Sql Server};Server=PRIMEDIADC;uid=sa;pwd=;database=try”  
Set rs = Server.CreateObject(“ADODB.RecordSet”)  
query = “SELECT \* FROM tbl\_admin WHERE user\_name=’” & strUsername & “’ AND password=’” & Pwd & “’”  
Set rs = conn.Execute(query)  
if rs.eof then  
conn.Close  
Set rs = Nothing  
Set conn = Nothing  
response.write("&answer=failed")  
else  
Session(“member”) = rs(“user\_name”)  
Session.Timeout = 20  
rs.close  
set conn = nothing  
set rs = nothing  
response.write("&answer=ok")  
End If  
%\>

* * *

What is the problem behind this? can anybody help me please…
