Thanks in advance.
Scott Ewine
For an ODBC Connection, use the following code sample
--------------------------------------------------------------------
With External_Report.Database.Tables(1).ConnectionProperties
.Item("DSN") = "DSNname"
.Item("Database") = "DBName"
.Item("User ID") = "UID"
.Item("Password") = "PWD"
End With
For an OLE DB Connection, use the following code sample
----------------------------------------------------------------------
With Report.Database.Tables(1).ConnectionProperties
.Item("Provider") = "Provider Name"
.Item("Data source") = "Server Name"
.Item("Initial Catalog") = "Database Name"
.Item("User ID") = "UID"
.Item("Password") = "PWD"
End With
Assuming you already have a reference to your report object, we'll call it
ole_rep, try this for ODBC:
oleobject ole_dbprop
ole_dbprop = create oleobject
ole_dbprop = ole_rep.database.tables[1].connectionproperties
ole_dbprop .Item("DSN").value = "YourDSNName"
ole_dbprop .Item("Database").value = "yourdatabasename"
ole_dbprop .Item("User ID").value = "userid"
ole_dbprop .Item("Password").value = "password"
Good Luck and HTH,
Jeff
"Scott Ewine" <s...@techassist.com> wrote in message
news:#WaydVuRDHA.238@forums-2-dub...
ole_dbprop = ole_rep.database.tables[1].connectionproperties
So we are getting closer, but the rest does not work. How can I browse the
object to see what properties it has?
Scott Ewine
"Jeff Nesler" <please_don't_spam_jneslerATsheakleyDOTcom> wrote in message
news:%23ifoAwxRDHA.298@forums-2-dub...
string ls_nameids[]
int li_loop
ole_dbprop = ole_rep.database.tables[1].connectionproperties
ls_nameids = ole_dbprop.nameids
//nameids property returns an array containing the name of each connection
property in the collection.
for li_loop = 1 to upperbound(ls_nameids)
messagebox("property", ls_nameids[li_loop])
next
It displayed DSN, Database, User ID and Password in the messagebox. You
could do it in the debugger too by setting a breakpoint after the assignment
of ls_nameids and checking its value.
If you have it, check out the Crystal Developer help file,
CrystalDevHelp.chm. It has all these properties listed.
As for browsing the object, couldn't find a way to do it with the PB
Browser, but you can do it with the MS OLE/COM Object Viewer. If you don't
have it, go here to download it:
http://www.microsoft.com/com/resources/oleview.asp
Once installed, go the File > View TypeLib...
That will allow you to browse and find the craxdrt9.dll. Open it and it
should show you more than you ever wanted to know... heirarchy,
methods/properties of each object & more.
HTH,
Jeff
"Scott Ewine" <s...@techassist.com> wrote in message
news:OLE3Ke6RDHA.238@forums-2-dub...