Peter Eberlein schrieb:
Hi Daniel,

Daniel Albuschat schrieb:
Hello,

Here's the script-snippet:

    Service = createUnoService("com.sun.star.sdb.DatabaseContext")

you have to use the com.sun.star.sdbc.DriverManager for those purposes.
In the Dev-Guide you will found how to connect with flat files.

may be the following will help you (not tested):

Dim mDBPropertiesText(7) As New com.sun.star.beans.PropertyValue
mDBPropertiesText(0).Name = "Extension"
mDBPropertiesText(0).Value = "csv"    
mDBPropertiesText(1).Name = "CharSet"
mDBPropertiesText(1).Value = "System"
mDBPropertiesText(2).Name = "FixedLength"
mDBPropertiesText(2).Value = false
mDBPropertiesText(3).Name = "HeaderLine"
mDBPropertiesText(3).Value = false
mDBPropertiesText(4).Name = "FieldDelimiter"
mDBPropertiesText(4).Value = ","
mDBPropertiesText(5).Name = "StringDelimiter"
mDBPropertiesText(5).Value = ""
mDBPropertiesText(6).Name = "DecimalDelimiter"
mDBPropertiesText(6).Value = ""
mDBPropertiesText(7).Name = "ThousandDelimiter"
mDBPropertiesText(7).Value = ""
        
sDatabaseURL = "sdbc:flat:"  & "file:///x:/MyFile.csv"
oEnvironment = createUnoService("com.sun.star.sdbc.DriverManager")
oConnection = oEnvironment.getConnectionWithInfo(sDatabaseURL,mDBPropertiesText())

Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to