-
ASP- flash saving to database
This is the code on the button in the flash movie, under text box strName
loadVariables("http://localhost/save_score.asp", "", "POST");
and this save_score.asp file
<%
DIM strName
if Request.QueryString("strName") <> "" then
strName = Request.QueryString("strName")
end if
DIM intScore
if Request.QueryString("intScore") <> "" then
intScore = Request.QueryString("intScore")
end if
Dim rsScore, dbConn, strSQLScore
Set dbConn = Server.CreateObject("ADODB.Connection")
Set rsScore = Server.CreateObject("ADODB.Recordset")
dbConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("highscores.mdb") & ";Persist Security Info=False"
strSQLScore = "INSERT INTO HIGH_SCORES (NAME, SCORE) Values ('"& strName &"','"& intScore &"')"
rsScore.Open strSQLScore,dbConn
Set rsScore = Nothing
dbConn.Close
Set dbConn = Nothing
%>
but the problem it is not saving anything to the database, i can't guess why?????can u ??
this is the error i am getting when i test the asp file itself in the browser
Error Type:
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
/savescore.asp, line 30
Last edited by certified; 12-20-2003 at 12:39 PM.
-
Note:
i can with another file read from the database into my flash file what means the connection with database is not the problem
thanks
-
ok do anyone here have a tutorial saving into access data base using ASP and posting from flash ??????????
thanks again
-
is there anybody here i am getting depressed from these files
-
say no more
Look at the fields of your database. What data type are they?
If you're trying to insert text into a numeric field - you could get that error or maybe the length of the string you are inserting is too long.
Hang on.....
Just seen it - You are using POST as your method to send the data from flash but you are using request.querystring in your asp....
Change the method to GET in flash or change request.queystring to just request...
It also looks like your database doesn't allow null values - that's why you're getting that error.
If you open up your database, you can change each field to 'Allow Nulls' or in access it's 'Required Field' ... I think or something like that.
That's where your problem lies.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|