Flash ,Database, FSCommand ASP

bill02
bill02 used Ask the Experts™
on
I have a web page that i am trying to use ASP to get fields from a database then send the data to variables to flash using a variable on the flash page. I am trying to determine what variables to send based on information comming from the FSCommand. I have no problem setting a variable or talking to a database the problem comes in when i try to combine the 2. here is the code to set a variable
<script language="vbscript";>
sub Test_FSCommand(ByVal command, ByVal args)
  Test.SetVariable "TestText", "8"
end sub
</script>
the movie is test the variable is called testtext. this sets a variable to what the fscommand sends to the web browser. The problem is the <script language="vbscript";> this does not work when changed to <%@Language="VBScript"%> which is needed to run my database code. i would very much appreciate if anyone can give me any information on this even if it is just asp code to pass variables to one another as long as i can recieve them in my flash code. I have been working on this for 2 days and haven't got anywhere.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Check these examples you will what you are looking for

http://www.smartwebby.com/Flash_and_ASP/default.asp
http://www.asp101.com/articles/flash/index.asp
http://www.netdogz.com/flash-asp-database-integration.asp
http://www.catapultic.com/resources/aspandflash1/
http://www.scripts.nl/flash/f-asp1.asp

If still you need help send your asp page and .fla file to rotdir@hotmail.com I will fix if for you.

Cheers
RootDir

Author

Commented:
All of the pages you have noted use LoadVariables. I need to use the FSCommand for this. I am open to anyway possible to do this. I will send you the ASP Page and the FLA via e-mail but i need this to be FSCommand I will send you several Files (database, ASP Page that works With flash, ASP Page i want to work, And the FLA.) Let me know what you find. Thanks

Author

Commented:
You Have Mail.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Here is the code i need to work it doesnt like the word server in this code. thanks



<script language="vbscript";>
sub Test_FSCommand(ByVal command, ByVal args)
  Test.SetVariable "TestText", GetInfo()
end sub

Function GetInfo()
 Dim oRS, oConn
 Set oRS = Server.CreateObject("ADODB.Recordset")
 Set oConn = Server.CreateObject("ADODB.Connection")
 oConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("employees.mdb")
 oConn.Open
 oRS.Open "SELECT * FROM Employees", oConn, 2, 3
 If oRS.EOF Then
      GetInfo = "Didn't Work"
 Else
      GetInfo = "Worked"
 End If
 oRS.Close
 Set oRS = Nothing
 oConn.Close
 Set oConn = Nothing
end Function
 </script>

Commented:
I got the answer for you, I did not received database, so I commented that part.

Change Tst_FSCommand function like this. Get output of GetInfo function to variable and assign that variable.

If you still get error then check GetInfo function

sub Test_FSCommand(ByVal command, ByVal args)
 myVar = GetInfo
 Test.SetVariable "TestText", myVar
end sub

Function GetInfo()
'Dim oRS, oConn
'Set oRS = Server.CreateObject("ADODB.Recordset")
'Set oConn = Server.CreateObject("ADODB.Connection")
'oConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("employees.mdb")
'oConn.Open
'oRS.Open "SELECT * FROM Employees", oConn, 2, 3
'If oRS.EOF Then
'     GetInfo = "Didn't Work"
'Else
     GetInfo = "Worked"
'End If
'oRS.Close
'Set oRS = Nothing
'oConn.Close
'Set oConn = Nothing
end Function

Cheers,

RootDir

Author

Commented:
I have done that. Have you tried to use this code on a database on the net. the problem is in the connect to database. i can connect when it the code is
<%@Language="VBScript"%>

<%
Dim oRS, oConn

 Set oRS = Server.CreateObject("ADODB.Recordset")
 Set oConn = Server.CreateObject("ADODB.Connection")

 oConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("employees.mdb")
 oConn.Open


 oRS.Open "SELECT * FROM Employees", oConn, 2, 3
 oRS.Find "NameLast = '" & UCase(Request.QueryString("strSearch")) & "'"
 If oRS.EOF Then
      Response.Write "NameLast=Not+Found&NameFirst=Not+Found&Position=Not+Found"
 Else
      Response.Write "NameFirst=" & Server.URLEncode(oRS("NameFirst")) & "&NameLast=" & Server.URLEncode(oRS("NameLast")) & "&Position=" & Server.URLEncode(oRS("Position")) End If
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing
   
%>
but when i change that to be inside <script language="vbscript";>
 it doesnt work. i see you remed out the database stuff i know it works with out that but now get it to work with it. Thanks so far but i have been past that point.

Author

Commented:
when it is in what i sent you it doesnt like server i get object required

Author

Commented:
when it is in what i sent you it doesnt like server i get object required

Commented:
Check this example I think you are modifying this example

http://www.asp101.com/articles/flash/index.asp

In above example you are trying to mix serverside code into clientside code that's why you got error "server object required"
When you put that inside serverside tag app get connected database.

Now you need to call serverside function from clientside to get output. I am still finding solution for this. Let me know if you find anything

RootDir

PAQed, with points refunded (500)

Computer101
E-E Admin

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial