View Full Version : Flash and SQL ... overflow????
sdw135
02-14-2005, 06:04 AM
I'm using ASP to communicate between Flash and MS Access.
Flash sends an SQL query to the database (via ASP) and the database returns the result to Flash which then puts the results in an array.
I'm having a problem when the result of the SQL query will be large... is this the problem?? Is there a maximum number of records (or bytes) I can receive???
Laguana
02-14-2005, 12:03 PM
I recall reading that there's a limit to the amount of data that can be sent via http, but i'm not entirely sure of that. As to a possible solution... You could make a .txt file briefly, and then delete it afterwards. Just an idea.
sdw135
02-14-2005, 02:50 PM
Is there a way to split the query results into manageable chunks that are sent back to Flash (and used to populate arrays) sequentially?
sdw135
02-14-2005, 05:04 PM
I'm trying to build an application that will query information such as latitude/longitude/time/dayOfWeek/etc. from an Access database. I've copied my code (AS & ASP) below... currently, the code only calls for 3 fields from the database... it will need to do more. It works with a small table... not a large one!! Thanks for the help!!
Here is my ASP:
<%
Dim DataConn
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.Open "Driver=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("myTRACKS.mdb")
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set rstGPStracks = Server.CreateObject("ADODB.Recordset")
cmdTemp.CommandText = Request.Form("myQuery")
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = DataConn
rstGPStracks.Open cmdTemp, , 1, 3
Dim Counter
Counter = 0
While Not rstGPStracks.EOF
Response.write "Lat_dd" & Counter & "=" & Server.URLEncode(rstGPStracks("Lat_dd")) & "&"
Response.write "Long_dd" & Counter & "=" & Server.URLEncode(rstGPStracks("Long_dd")) & "&"
Response.write "Time" & Counter & "=" & Server.URLEncode(rstGPStracks("Time")) & "&"
Counter = Counter + 1
rstGPStracks.MoveNext
Wend
Counter = 0
Response.write "TotalRecords=" & rstGPStracks.RecordCount
rstGPStracks.Close
DataConn.Close
Set DataConn = Nothing
Set rstGPStracks = Nothing
%>
And, here is my AS:
function executeQuery() {
loadMessage.text = "Please wait...";
//
//The following constructor is in the on(release) of the "dbQuery" button:
//dbQuery = new LoadVars();
//
var userQuery = "SELECT " + cbSelect.getSelectedItem().data;
userQuery = userQuery + " FROM " + cbFrom.getSelectedItem().data;
userQuery = userQuery + " WHERE " + cbWhere1.getSelectedItem().data + " " + cbWhere2.getSelectedItem().data + " " + cbWhere3.getSelectedItem().data;
//
//trace(userQuery);
//trace("");
//
dbQuery.myQuery = userQuery;
dbQuery.Record = 0;
//
dbQuery.sendAndLoad("http://localhost/FlashMXTest/queryMyTracks3.asp", dbQuery);
//\\
dbQuery.onLoad = function(success) {
if (success) {
loadMessage.text = "Total Records = " + dbQuery.TotalRecords;
var i = -1;
latArray = new Array();
longArray = new Array();
timeArray = new Array();
while (++i < dbQuery.TotalRecords) {
var lat = "Lat_dd" + i;
var long = "Long_dd" + i;
var time = "Time" + i;
//
latArray[i] = dbQuery[lat];
longArray[i] = dbQuery[long];
timeArray[i] = dbQuery[time];
//
trace("latArray[" + i + "]: " + latArray[i]);
trace("longArray[" + i + "]: " + longArray[i]);
trace("timeArray[" + i + "]: " + timeArray[i]);
trace("");
}
} else {
loadMessage.text = "Error retrieving records from the database!";
}
//The following delete is in the on(release) of the "dbQuery" button:
//delete dbQuery;
};
}
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.