现在连得是ACCESS数据库,谁能帮我改一下,用的用户名密码是sqlserver格式就行,感激不尽。
function AddBatteryCode() {//添加电池信息到数据库
var sqlconnection = new ActiveXObject("ADODB.Connection");//数据库连接对象
var DataSource = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= Test.mdb";//数据库源,数据库名称,用户名,密码
sqlconnection.Open(DataSource);
var EqNo=@0\EqNo;
var TrayNo = @0\TrayNo;
var BatteryCode = @0\BatteryCode;
var myDate=new Date();
var time = myDate.getFullYear()+"年"+(myDate.getMonth()+1)+"月"+myDate.getDate()+"日"+myDate.getHours()+"时"+myDate.getMinutes()+"分"+myDate.getSeconds()+"秒";
var sqlstring = "INSERT INTO [RB01](Date_Time, EqNo,TrayNo, BatteryCode) VALUES('" + time + "', '" + EqNo + "', '" + TrayNo + "', '" + BatteryCode + "')";
var last = sqlconnection.Execute(sqlstring);
sqlconnection.Close();
}
相关分类