To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=41911
Issue #:|41911
Summary:|executeQuery converts table names to upper case
Component:|Database access
Version:|680m74
Platform:|All
URL:|
OS/Version:|All
Status:|UNCONFIRMED
Status whiteboard:|
Keywords:|
Resolution:|
Issue type:|DEFECT
Priority:|P3
Subcomponent:|none
Assigned to:|msc
Reported by:|pitonyak
------- Additional comments from [EMAIL PROTECTED] Wed Feb 2 07:20:38 -0800
2005 -------
I am experimenting with database access using macros. When I execute a query
from a macro, the table names are always sent as upper case. The default
database (HSQLDB) has case sensitive table names. The end result is that it is
NOT possible to access an HSQLDB table unless it was created using all upper
case.
I created a base document that demonstrates the problem. I was going to attach
add a macro to the Base document, but it looks like a Base document can not act
as a macro library container. Most unusual... well, here is the macro that I
wrote that should work with the document that I will attach... I tried using
things such as escape processing and that did not work.
Sub BrokenSQL()
Dim oTables
Dim oStatement
Dim oResultSet
Dim oBaseContext
Dim oDataBase
Dim oCon
Dim i As Integer
Dim dbFileName As String
Dim sSQL As String
dbFileName = ConvertToURL("C:\Broken.odb")
oBaseContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
oDataBase = oBaseContext.getByName(dbFileName)
oCon = oDataBase.getConnection("", "")
oTables = oCon.getTables()
MsgBox "The database " & dbFileName & " contains the following tables:" & _
CHR$(10) & CHR$(10) & Join(oTables.getElementNames(), CHR$(10))
oStatement = oCon.createStatement()
sSQL = "select * from ALLUPPER"
Print "Ready to use SQL: " & sSQL
oResultSet = oStatement.executeQuery(sSQL)
If Not IsNull(oResultSet) Then
oResultSet.next
Print "A Returned Value = " & oResultSet.getString(2)
End If
sSQL = "select * from NotUpper"
Print "Ready to use SQL: " & sSQL
oResultSet = oStatement.executeQuery(sSQL)
REM You never get here!
If Not IsNull(oResultSet) Then
oResultSet.next
Print "A Returned Value = " & oResultSet.getString(2)
End If
oCon.close()
Exit Sub
ErrorHandler:
MsgBox "Error " & Err & ": " & Error$ + chr(13) + "At line : " + Erl + chr(13)
+ Now , 16 ,"An Error Occurred"
oCon.close()
End Sub
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]