Flash and database connection (ASP article)

Source: Internet
Author: User
Tags variable
Data | database | Database connection a long time ago found a lot of flash friends post help Flash and database connection, so I studied, decided to write down on the Asp\php\jsp database connection method, today to everyone's flash and database Connection (ASP), I will continue to serve for everyone, I hope you often come to my blog guest! A total of three documents are required (see figure II). First write ASP file, named Save.asp. The specific code is as follows: <%
U_name=request.form ("name")
U_company=request.form ("Company")
U_relation=request.form ("relation")
U_url=request.form ("url")
U_msg=request.form ("MSG")
Set conn=server.createobject ("ADODB. Connection ")
Conn. Open "Driver={microsoft Access Driver (*.mdb)};D bq=" & Server.MapPath ("Msg.mdb")
Sql= "Insert into data (name,company,relation,url,msg) VALUES (' &U_name&" ', ' "&u_company&" ', ' "&u _relation& "', '" &u_url& "," "&u_msg&" ""
Conn. Execute (SQL)
Conn.close
Set conn=nothing
Response.Write "&temp=ok"
%> below we do Access file, named msg.mdb! Create a table and name it as a data table. Create field name: ID; Name; Company; Relation; URL; MSG; Time. Data types are set to: automatic numbering; text; text; text; text; remark; date/time. Save shutdown. Finally we do flash, filename I get up a conn bar! In the work area, follow the map, one layer per component! The new top layer adds the following code to the last chastity:
System.usecodepage = true;
Name = "";
Company = "";
Relation = "";
URL = "";
MSG = "";
function SendData () {
if (Name!= "&& company!=" "&& relation!=" "&& Msg!=" ") {
var MyVar = new Loadvars ();
Myvar.name = Name;
Myvar.company = Company;
Myvar.relation = relation;
Myvar.url = URL;
Myvar.msg = MSG;
Myvar.sendandload ("http://localhost/6/save.asp", MyVar, "POST");
temp = "Submit, please wait ...";
Myvar.onload = function (success) {
if (success) {
temp = "Oh! success!" Come on, one more ... "
Name = "";
Company = "";
Relation = "";
URL = "";
MSG = "";
} else {
TEMP = "Failed!" Maybe there's a problem with the network! ";
}
};
} else {
temp = "Please input integrity!" ";
}
}
Sendbtu.onrelease = function () {
SendData ();
};
Clearbtu.onrelease = function () {
temp = "Welcome to your message!" ";
Name = "";
Company = "";
Relation = "";
URL = "";
MSG = "";
};
Stop (), and then the corresponding input text basket variable to the corresponding name! The variable named the input text basket after the name: name. If you have any questions please leave a message below, I will help you to solve as soon as possible!
Attachment:

figure I

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.