PDA

View Full Version : help on flash DB


cloud7
04-21-2003, 08:37 AM
i got this source code from a site. but i cant get it to work. can anyone here tell me what went wrong?

this is in my asp file:

<% Language = "VBScript" %>

<%

Dim conn
Dim rs
Dim query

Set conn = server.createObject("ADODB.Connection")
conn.open"studDB"

Set rs = server.createObject("ADODB.Recordset")

query = "select * from information"

rs.Open query, conn, 3, 3

rs.addNew

rs("name") = Request("name_out")
rs("admin") = Request("admin_out")
rs("group") = Request("group_out")
rs("marks") = Request("score")

rs.update

rs.close
conn.close
Set rs = Nothing
Set conn = Nothing

%>


this is in my flash:

loadVariablesNum ("studDB.asp", 0, "GET");

teriba
04-21-2003, 09:21 PM
You have to write either request.form or request.querystring (depending on were you are getting youre data from)

ps. It is much better to add new records with SQL instead of ADODB ds.

cloud7
04-22-2003, 07:57 AM
this is how my new asp looks like~but, it still doesnt work...

in my flash, do i just need to name my fields with the variableS?
or do i still need other codings?


<% Language = "VBScript" %>

<%


Dim conn
Dim rs
Dim query

'Create a connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
Set adoRec = Server.CreateObject("ADODB.Recordset")

'Open connection to the database driver
strCon="DRIVER={Microsoft Access Driver (*.mdb)};"

'Open Connection to database
strCon = strCon & "DBQ=" & Server.MapPath("studDB.mdb")

'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "INSERT INTO information VALUES('" & Request("name_out") & "', '" & Request("admin_out") & "', '" & Request("group_out") & "', " & Request("score") & ");"


adoCon.Open strCon

'Write to the database
adoCon.Execute(strSQL)

'Reset Sever Objects
Set adoCon = Nothing

%>