# Insert data into database from Flash

**URL:** <https://forum.kirupa.com/t/insert-data-into-database-from-flash/284159>\
**Category:** flash\
**Created:** [March 16, 2009, 6:27am UTC](https://forum.kirupa.com/t/insert-data-into-database-from-flash/284159 "2009-03-16T06:27:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nupur2609](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@nupur2609](https://forum.kirupa.com/u/nupur2609)\
**Post date:** [March 16, 2009, 6:27am UTC](https://forum.kirupa.com/t/insert-data-into-database-from-flash/284159/1 "2009-03-16T06:27:35Z")

</div>

Hi  
I am completely new to Flash and actionscript.I have a small project which requires me to submit details into a MS Access Database. I have created an asp scrip to do the same but it doesnt seem to be working. I am posting the code.Please Help !!

my fla code

* * *

import flash.events.Event;  
import [flash.net](http://flash.net).\*;  
Enter\_btn.addEventListener(MouseEvent.CLICK,Submit);  
function Submit(event:MouseEvent):void{  
var myRequest:URLRequest = new URLRequest(“DB11.asp”);  
var myLoader:URLLoader = new URLLoader();  
var myVariables:URLVariables = new URLVariables();

myVariables.tVF = “5”;  
myVariables.tVB = “6”;  
myVariables.tAF = “7”;  
myVariables.tVB = “8”;  
myVariables.tTotal = “9”;

trace(myVariables.tVF);

myRequest.method = URLRequestMethod.POST;  
myRequest.data = myVariables;  
myLoader.addEventListener(Event.COMPLETE, onLoaded);  
myLoader.load(myRequest);  
function onLoaded(evt:Event):void {  
trace(“here we get the data back:” +myLoader.data);  
}  
}

my asp Code

* * *

\<%@language = “VBScript” %\>  
\<%

strVF = Request(“tVF”)  
strVB = Request(“tVB”)  
strAF = Request(“tAF”)  
strAB = Request(“tAB”)  
strTotal = Request(“tTotal”)

strDB = “DRIVER={Microsoft Access Driver (\*.mdb)};DBQ=” & Server.MapPath(“BaselineTest.mdb”) & “;DefaultDir=” & Server.MapPath(".") & “;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5”

MyPath=Server.MapPath(“BaselineTest.mdb”)  
Set conn = Server.CreateObject(“ADODB.Connection”)  
conn.Open strDB

SQLInstr = “INSERT INTO Score (AF, AB, VF,VB,Final) VALUES (’” & strAF & “’,’” & strAB & “’,’” & strVF & “’,’” & strVB & “’,’” & strTotal & “’)”  
conn.Execute SQLInstr  
Response.Write(“OK”)  
Conn.close  
%\>

I am running it Using IIS 7.0 and all the files are in my wwwroot folder.  
What am I doing wrong here??

Thanks
