在线请高手指点数据库问题,部分代码全给出,请大家帮我指点指点???????急急急
function InsertLabel(){
var Tip = top.frames["FrameBottom"].document.all("x",0);
var Tip1 = top.frames["FrameBottom"].document.all("y",0);
var labelname,labeladdrise,labeltel,mapx,mapy;
frm=document.form1;
if(true)
{
labelname=frm.name.value;
labeladdrise=frm.addrise.value;
labeltel=frm.tel.value;
}
mapx=Tip.innerHTML;
mapy=Tip1.innerHTML;
try
{
var conn=createConn();
window.confirm(conn);
var sql="select * from labelifo";
var rs=createRst();
rs.open(sql,conn,1,3);
conn.Open();
if(!rs.BOF&&!rs.EOF)
{
rs.AddNew();
rs.fields("labelname")=labelname;
rs.Fields("labeladdrise")=labeladdrise;
rs.fields("labeltel")=labeltel;
rs.Fields("mapx")=mapx;
rs.Fields("mapy")=mapy;
}
}
catch (e)
{
errorMessage(e);
}
rs.close();
rs = null;
conn.close();
conn = null;
}
function createConn()
{
//连接SQL数据库
var conn=new ActiveXObject("adodb.connection");
var strConn = "Provider=SQLOLEDB.1;User ID=sa;Password=sa;Initial Catalog=OADB;Data Source=192.168.0.2"
conn.Open(strConn); //到这里Open就不执行???????
return conn;
}
function createRst()
{
var rst=new ActiveXObject("ADODB.RecordSet");
return rst;
}