-
i gound a way (thru flashkit great resources) to store data via a ASP page into a access database.
i could store variables and i adjusted the ASP page in order to store 3 variables...but now it doesn't work!
anyone a cleu if a say that this is the ASP code:
dbpath = Server.MapPath("scoretabel.mdb")
strDBname = "Driver={Microsoft Access Driver (*.mdb)}; UID=admin; DBQ=" & dbpath
strDBuser = ""
strDBpwd = ""
dbaction = request("dbaction")
select case dbaction
case "opslaan"
'** opslaan in access database
strsql = "insert into scorestore (name,keus,tied) values ("
strsql = strsql & "'" & request("name") & "',"
strsql = strsql & "'" & request("keus") & "',)"
strsql = strsql & "'" & request("tied") & "')"
dbexecute(strsql)
Response.Write("Result=ok")
end select
%>
next line are used by flash to send
result = "";
name = ../:name;
keus = ../:keus;
tied = ../:tijd;
dbaction = "opslaan";
loadVariables ("send.asp", self, "POST");
i just don't seem to get the "result=ok" back as i dit before with just 2 variables.
pls anyone?
-
Originally posted by Sjekke
i gound a way (thru flashkit great resources) to store data via a ASP page into a access database.
i could store variables and i adjusted the ASP page in order to store 3 variables...but now it doesn't work!
anyone a cleu if a say that this is the ASP code:
dbpath = Server.MapPath("scoretabel.mdb")
strDBname = "Driver={Microsoft Access Driver (*.mdb)}; UID=admin; DBQ=" & dbpath
strDBuser = ""
strDBpwd = ""
dbaction = request("dbaction")
select case dbaction
case "opslaan"
'** opslaan in access database
strsql = "insert into scorestore (name,keus,tied) values ("
strsql = strsql & "'" & request("name") & "',"
strsql = strsql & "'" & request("keus") & "',)"
strsql = strsql & "'" & request("tied") & "')"
dbexecute(strsql)
Response.Write("Result=ok")
end select
%>
next line are used by flash to send
result = "";
name = ../:name;
keus = ../:keus;
tied = ../:tijd;
dbaction = "opslaan";
loadVariables ("send.asp", self, "POST");
i just don't seem to get the "result=ok" back as i dit before with just 2 variables.
pls anyone?
First thing that jumps out is sql statement built wrong, try this
mydb=server.mappath("scoretabel.mdb")
strconn="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
strconn=strconn & mydb & ";"
set connstr=server.createobject("adodb.connection")
connstr.open strconn
strSQL = "insert into scorestore (name,keus,tied) values (" & _
"'" & request.form("name") & "'," & _
"'" & request.form("keus") & "'," & _
"'" & request.form("tied") & "')"
set rstemp=connstr.execute(strSQL)
I assume all field are text fields as you've surrounded the values with single quotes. Then instead of writing OK straight away, check that no errors occurred in the connection with
if connstr.Errors.Count = 0 then
Response.Write("Result=ok")
end if
hope this helps.
Phil
[Edited by UKPOD on 10-26-2001 at 05:40 AM]
-
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
|