John,
You left out some information....
1) What version of OpenOffice.org are you using?
2) What type of databse are you using?
3) Do you use a registered datasource?
I only have experience with 2.0 beta
Frank Sch�nheit wrote:
Hello John,
I'm answering your mail in our project's users mailing list,
[EMAIL PROTECTED] Please note that this list is the better place
for comments as yours than mailing me directly. This is a matter of
scaling (more people than me could answer) and a matter of sharing
knowlege (more people than you could read the potential answer).
I'd like to ask you to also reply to this list. You can post to it
without being subscribed, however your mails need to pass moderation
then, which can cause delays. Best way is to subscribe to the list at
http://dba.openoffice.org/servlets/ProjectMailingListList. If you prefer
newsgroups over mailing lists: news.gmane.org mirrors the list.
In your example, is "sdbc.odbc.pp" the name of a registered data source?
(you can find out at Tools|Data Sources [OOo 1.x] or
Tools|Options|Base|Databases [OOo 2.0 alpha/beta]). To me it sounds as
if isn't ....
In any way, you need a data source or database document (again this
depends on the OOo version you're working with) which describes the
connection to your SQL server database. You can either create this
programmatically in your macro, or only once in the OOo GUI.
The way to do this differs in OOo 1.x and 2.0 (slightly in the API and
heavily in the GUI), so: which version are you working with?
Ciao
Frank
John Shaller wrote:
I'm new to OO and have been trying in vain to find a usable script for
accessing our SQL*Server tables via OOo macros. I've seen many of
your replies to others in the same boat, but I still can't get it to
work.
I can access the data via Forms in the OpenOffice.org database module
without any problem, so I know the connection works. But I need to
manipulate the data via macros, but I cannot find any example on your
website that I can get to work.
I used your example you wrote on 10.Feb.2003, and below is my entire macro:
====================================================
Sub main()
doSomething()
End Sub
Sub doSomething
oRowSet = createUnoService( " com.sun.star.sdb.RowSet ")
' following lines always crash with "BASIC runtime rrror: Object
variable not set"
oRowSet.DataSourceName = "sdbc.odbc.pp" ' the SQL*Server database name = pp
oRowSet.CommandType = com.sun.star.sdb.CommandType.COMMAND
oRowSet.Command = "select * from scans"
oRowSet.setString( 1, "1" )
oRowSet.execute
oRowSet.next
while ( not oRowSet.isAfterLast )
print oRowSet.getString(1)
oRowSet.next
wend
End Sub
=======================================================
I'm really sorry to bother you with such trivial problems, but I just
cannot find the solution on my own.
I thank you in advance for any help you can offer.
Best regards,
John Shaller
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm
Free Info: http://www.pitonyak.org/oo.php
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]