仅访问Microsoft Access 2010 usnig javascript [英] Accessing Microsoft Access 2010 usnig javascript only
问题描述
您好
我想开发一个由javascript组成的html,它应该从ms访问中获取数据而不使用任何服务器端。基本上我想要一个应用程序可以检索存储在ms访问数据库中的数据只有javascript我有
搜索到互联网但我无法从任何地方找到源,有没有办法做到这一点忽略安全我想要的概念是否可行。我刚刚搜索互联网,但我找不到相关但有些显示ADO对象
但我无法得到结果,有些显示oledb和一些喷气机驱动程序,但这些都不适合我。
I want to develop an html which consists of javascript that should fetch the data from ms access without using any server side. Basically i want a application that can retrieve the data stored in the ms access database with only javascript i have searched the internet but i couldn't find the source from any where, is there any way to do that ignoring the security concepts i just want will this be possible or not. I have just searching internet but i couldn't find the related but some showed ADO objects but i couldn't get the results and some showed oledb and some jet driver but none of this worked for me.
请提前谢谢
推荐答案
I从来没有尝试使用Access 2010,但它适用于旧版本。 希望这会有所帮助。
I have never tried this with Access 2010, but it worked with older versions. Hopefully this will help.
var conn = new ActiveXObject( "ADODB.Connection" );
var rs = new ActiveXObject( "ADODB.Recordset" );
var sql = "SELECT ... your sql here";
conn.Provider = "Microsoft.Jet.OLEDB.4.0";
conn.Open( "your_file.mdb" );
rs.Open( sql, conn );
if ( ! rs.EOF && ! rs.BOF )
{
for ( rs.MoveFirst(); ! rs.EOF; rs.MoveNext() )
{
var your_variable = rs( "your_sql_field_name" ).Value;
// now do something
}
}
这篇关于仅访问Microsoft Access 2010 usnig javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!