简体   繁体   中英

ADODB Error inserting to Access DB with JavaScript

I am writing an .asp file to insert data to an Access database using the following JS:

    MM_query =  "INSERT " + 
                "INTO Employees (FirstName, Surname, Department, Email, FaxNumber, JobTitle, KnownAs, MobileTelephone, WorkTelephone, MUGSHOT, WorkExtension, UseInPhoneWeb, Staff, Office, MobileSpeedDial, CompanyID1) " +
                "VALUES (\"" + textFirstname + "\", \"" + textSurname + "\", \"" + selectDept + "\", \"" + textemailAddress + "\", \"" + textFaxTel + "\", \"" + textJobTitle + "\", \"" + textAKA + "\", \"" + textMobile + "\", \"" + textWorkNo + "\", \"" + selectMugShot + "\", \"" + textExtn + "\", 1, 1, \"" + selectOffice + "\", " + textMobSpDial + ", " + selectCompany + ")";

    var conn = Server.CreateObject("ADODB.Connection");
    conn.Open(MM_PhoneWeb_conn_STRING);

    var rs = Server.CreateObject("ADODB.Recordset");
    rs.Open(MM_query, conn);

    conn.Close();

Upon execution I get the following error:

An error occurred on the server when processing the URL. Please contact the system administrator. 

The query works when pasted directly to access and similar code works for retrieving data from the DB.

Can anyone suggest how best to troubleshoot?

IIS用于插入数据库的帐户对包含的文件夹/数据库具有只读权限。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM