Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Flash (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 12th, 2003, 04:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default Flash & SQL

Hi there

I'm attempting to get Flash MX and SQL to converse - I've never done it before with Flash - can anyone help me - I need to create an odbc connection to the db and then request some records within Flash.

Many thanks

Adam
 
Old September 12th, 2003, 08:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I know Flash makes Data connection kit for this purpose http://www.macromedia.com/software/dataconnection. The new Flash MX 2004 profressional is suppose to include this.

I have made the connection outside of Flash and imported it in through the source link, I'm not sure how dynamic you need it to be.
VALUE="Flashfile.swf?Counter=1111">
src="Flashfile.swf?Counter=1111"

loadVariablesNum ("counter.asp", 0);
start_Count = int(Counter)
cur_Count = (start_Count + 1)
 
Old September 15th, 2003, 08:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

Hi Harpua

Well, I need to be able to read data from a SQL database - How do I make the connection? Do I write the SQL SELECT statement in flash for the data that I want to retrieve?

Thanks, Adam
 
Old September 15th, 2003, 09:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry I'm not always clear sometimes. I use ASP and create a connection string outside of Flash on my page, from there it will pull the Data in. The only problem with this is that it isn't dynamic. Once the page is loaded you would have to refresh the page to get new data, which kind of defeats the purpose of Flash. For the more dynamic content I would check into the data connection kit.

<%
Set objConn = Server.CreateObject("ADODB.Connection")
        strConnect = "Provider=SQLOLEDB;Data Source=00.000.000.00;User Id=XXXXX;Password=XXXXX;Initial Catalog=XXXXXX;"
objConn.Open strConnect

    strSQL = "SELECT LastCount FROM TableName;"

    Set objCmd = Server.CreateObject("ADODB.Command")
    objCmd.ActiveConnection = objConn

    objCmd.CommandText = strSQL
    objCmd.CommandType = adCmdText

    Set objSelect = objCmd.Execute
    Set objCmd = Nothing

%>

VALUE="Flashfile.swf?Counter=<%= objSelect("LastCount") %>">
src="Flashfile.swf?Counter=<%= objSelect("LastCount") %>"

Inside Flash___
loadVariablesNum ("counter.asp", 0);
start_Count = int(Counter)
cur_Count = (start_Count + 1)
 
Old December 22nd, 2006, 07:45 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your flash (running on a web client) needs to talk to your web server and your web server talks to the SQL server. For this to work you need to code in flash, a web scripting language like php/asp/cold fusion/jsp, and then the web server talks sql to your database.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report & VB6 & SQL Server wlho VB How-To 2 June 5th, 2013 01:58 AM
flash & c# titto_oo7 C# 1 April 29th, 2006 02:41 PM
JavaScript & Flash lmod Javascript 2 September 6th, 2005 10:18 AM
flash & asp/sql integration Adam H-W Flash (all versions) 2 February 18th, 2004 12:49 PM
sql & join tables & find a field in multiple table trangd Beginning PHP 2 January 29th, 2004 07:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.