Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


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+unsubscribe@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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.