View Single Post
  #7 (permalink)  
Old 11-22-2006, 10:18 AM
panjavishnu panjavishnu is offline
Junior Member
 
Join Date: Nov 2006
Posts: 5
Default Re:How to connecting to databases using SWFKit(SWFKit 2 and SWFKit Pro 2)

Thank you for your immediate response.

But here 'stud' is my table name. I followed your suggestion but this time it is not retrieving data. When i use 'stud' in my statement it retrieving the data. so there is no problem with table name.

Code:
var conn = new ActiveXObject("ADODB.Connection");
connstr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = D:\\student.mdb";
conn.open(connstr);

var record = conn.Execute("select Name,age from stud");

var fld = record.Fields["age"];
var sname = record.Fields["Name"];

sname.value = "vishnu";
conn.update();
trace(sname.value.toString());
trace(fld.value.toString());

conn.close();

Output:
ADODB.Field:Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.. See also: C:\WINDOWS\HELP\ADO270.CHM.
Warning: unknown method "update"
Warning: unknown method "toString"
undefined
30

In the above output 30 is from age in table 'stud'.
But when i am trying to update the data its not working.
INSERT is also not working.

Please give me a solution.
If possible please attach an example of database retrieving and updating in ms access.
Thank you again for your quick response.
Reply With Quote