在javascript中可不可以調用sql語句?

tianyajian2 2003-05-19 06:46:58
在javascript中可不可以調用sql語句?或者是直接嵌入到javascript語句中。謝謝!!
...全文
70 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
imafool 2003-05-19
  • 打赏
  • 举报
回复
原始98下能跑吗?
wfylg 2003-05-19
  • 打赏
  • 举报
回复
没有用过,不过楼上的那位朋友代码确实没错的
孟子E章 2003-05-19
  • 打赏
  • 举报
回复
var rsTopTen
var strInner
var strCntInner
var ConnectionString

// Create the Recordset Object
rsTopTen = new ActiveXObject("ADODB.Recordset");

// Build the connection string
//
// ConnectionString Format below:
//ConnectionString = "DRIVER=SQL Server;SERVER=MySQLServer;CATALOG=MyDatabase;UID=USERID;PWD=Password";
//
// for SQL 7.0:
//ConnectionString = "DRIVER=SQL Server;SERVER=TopTen;CATALOG=TopTen;UID=TopTen;PWD=TopTen";
//
// for Access Database (on Server):
//ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\\\\demwwwdev01\\develop\\im\\security\\TopTen.mdb";
//
// for Access Database (on local drive):
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=C:\\TopTen\\TopTen.mdb";

// Build a SQL statement
strSQL = "SELECT TopTenName, TopTenCount FROM TopTen ORDER BY TopTenCount DESC";

// Open the recordset
rsTopTen.Open(strSQL, ConnectionString, 3,1,1);

// Set variable
var nCounter
nCounter = 0;

// Loop through the Recordset
while(!rsTopTen.EOF)
{
孟子E章 2003-05-19
  • 打赏
  • 举报
回复
可以

87,987

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧