PDA

View Full Version : Fetching information from microsoft access to flash with ASP with ASP



SLamaJama
August 4th, 2003, 09:56 PM
im looking for is a code which allows me to check the information without using the flash application...for example ..viewing the file in IE and when the correct user log in a smallwindow will appear saying that the pserson has logged in for example ... [Welcome Syed] and the user's loggin info will be recorded in the database in any means whether its by a tick or just an indication..

Digitalosophy
August 4th, 2003, 10:22 PM
ok well here goes

login.asp


<% @Language="VBScript"
<%
un=request("un") 'request form login variables
pw=request("pw")


Dim conn, rsNames 'delcare some vars

MyPath=Server.MapPath("database.mdb")

Set conn=Server.CreateObject("ADODB.Connection")

conn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & MyPath

SQL= "SELECT * FROM ADMIN"

Set rsNames = conn.Execute(SQL) 'execute the sql query


Match = "no"

Session("un")=un
Session("ps")=ps


Do While Not rsNames.EOF 'execute sql query until no more entries

If un=rsNames("USERNAME") And pw=rsNames("PASSWORD") Then

Match= "yes"

End if
%>

<% rsNames.MoveNext %>

<% Loop %>

<% Response.Write (Match)
If Match= "yes" then
Response.Redirect un & "yourprotectedpage.asp" 'this can be the page you want to protect
End If
%>



that will check a db with a table called ADMIN with fields called USERNAME, PASSWORD

to say "Welcome Digitalosophy" use the something like this


<% name=Request.Form("USERNAME") %>
<%=("name") %> 'shortcut for
<% Response.Write("name") %>

SLamaJama
August 5th, 2003, 08:35 PM
this is in the asp..yea..(im using notepad) ..but how abt the flash codes... ? i currently trying to figure out previous examples..

Digitalosophy
August 5th, 2003, 08:36 PM
what?
im looking for is a code which allows me to check the information without using the flash application

????????

SLamaJama
August 5th, 2003, 09:25 PM
ohh.. got missed up there.. what i meant was... check the information without using flash application as the reference...ya know when u add "trace" it will display the output in flash...what i was looking for , is a code which will display the output which is e.g "welcome to starworld" either by popping out a screen or just displaying it on the browser...

SLamaJama
August 5th, 2003, 09:26 PM
sorry for the vagueness... :)

Digitalosophy
August 5th, 2003, 10:31 PM
well you can display it on the browser a number of ways, either way you need some server side script to send that info to the browser. i would say the easiest way is


<%= myVar %>


in you case you will need to pull the data from the asp script


<%
un=request("un")
Response.Write ("un") %>


that will output the users name to the browser.

you can pass that var to flash if u'd like and load the vars(AS) and print them