Le 19/08/13 14:30, mhaverin a écrit : Hi,
> DatabaseContext = createUnoService("com.sun.star.comp.sdbc.ado.ODriver") > Connection = DatabaseContext.connect("sdbc:ado:PROVIDER=sqloledb;DATA > SOURCE=myserver;INITIAL CATALOG=mydb;USER ID=user;PASSWORD=pwd", flatProp()) > Statement = Connection.prepareStatement("SELECT col1 FROM tbl1 WHERE col2 = > ?") > Statement.setString(1, "bbbb") > ResultSet = Statement.executeQuery() > MsgBox ResultSet.getString(1) > End Sub > > When I run the script, I get a com.sun.star.sdbc.SQLException (Incorrect > syntax near ':'..) at the executeQuery() line. > > If I replace the question mark in the query with 'bbbb' the code works fine. So the question is not whether you can use prepared statements, but whether you can use parameterized queries in prepared statements ? I guess I would start with whether the simple parameterized SQL statement actually runs correctly from within the LO Query SQL editor ? Alex -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted