Keywords: 3132 error when using DAO
Question:
I get error 3132 'OLE has not been initialised (or string is missing its quotes)' at the the line...ws = dao.CreateWorkspace("JetWorkspace", "admin", "")This error only happens with the compiled code - it works fine from the interpreter (within WinBatch Studio).
I assume I've left something out but can't track it down. Any help would be appreciated.
Sample code
dao = objectopen("DAO.DBEngine.35") ws = dao.CreateWorkspace("JetWorkspace", "admin", "") db = ws.OpenDatabase("%WorkDir%ServData.mdb") sqlstr = "SELECT * FROM SERVER ;" rs = db.openrecordset(sqlstr) SServer = rs.fields("Servername") rs.ADDNEW SServer.value = "%ThisServ%" rs.UPDATE ObjectClose(rs) ObjectClose(db) ObjectClose(ws) ObjectClose(dao)Answer:
- Just a thought.... because a similar thing occured with me between the command line and compiled version:
rather than call the DBEngine directly
oAPP = OpenObject("Access Application.8") DB = oAPP.DBEnginethen create your workspace.
- Another possiblity: Compiler and Interpreter are not the same version number. Possibly using a newer interpreter and an older compiler. Make sure they're the same version by adding ver=Version() to the top of your code and display it in a message box (run it both uncompiled and compiled).
- And another possiblity: Compiler code running on a different environment, causing problems. For testing....Put the compiled exe in your WinBatch\System directory and test from there as a logged on user (not a service job or anything). See if it works. If it works, then possibly there is a broken or out-of-date file in your test area, most likely WBO??34I.DLL (If you are using WB2001).
Article ID: W14425Filename: 3132 error when using DAO.txt