use ADO:var conn = new ActiveXObject("ADODB.Connection"); ....
Sorry, didn't see that you wanted to access the local database without using ActiveX. But I can tell you, there is no way to do that by just using "pure" Javascript code
karma(无为): 我用过ActiveXObject("ADODB.Connection"),但提示出错。 能给出详细的用法吗?(pure Javascript no way 用ActiveX也试试吧。)
for example,var strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\XXXX.mdb;User ID=sa;Password=;" var dbc = new ActiveXObject("ADODB.Connection"); dbc.open(strConnect);var rs = dbc.execute("select * from table"); while (!rs.EOF) { //do something here rs.moveNext(); }
rs.close(); rs = null;strUpdate = "update table set x=a where y=b"; dbc.execute(strUpdate);dbc.close(); dbc = null;
当然只在每个用户自己的机器上做。
有什么好办法?
....
我用过ActiveXObject("ADODB.Connection"),但提示出错。
能给出详细的用法吗?(pure Javascript no way 用ActiveX也试试吧。)
var dbc = new ActiveXObject("ADODB.Connection");
dbc.open(strConnect);var rs = dbc.execute("select * from table");
while (!rs.EOF)
{
//do something here
rs.moveNext();
}
rs.close();
rs = null;strUpdate = "update table set x=a where y=b";
dbc.execute(strUpdate);dbc.close();
dbc = null;
用frontpage2000工具菜单(具体忘了)下的站点设置里有数据库设置,进行配置后可以的。
你试试。
还是有错误:找不到可安装的ISAM。
按你的方法试了,提示“无效的ISAM”。
试验成功,谢谢。