views:

26

answers:

1

I want to use a DNS-less connection Report in order not to set the DNS each time that I install my application but I have problems when I try to set the connection string from C#, the best thing that I have found is: http://stackoverflow.com/questions/674363/how-do-i-change-a-crystal-reports-odbc-database-connection-at-runtime

I have tried with

rpt.DataSourceConnections[0].SetConnection("Driver=Firebird/InterBase(r) driver", Properties.Settings.Default.pathdbsga, "SYSDBA", "masterkey");

but it's always give me an error: "Login Failed" and also it shows the login window.

Has anybody connected a c# app with a DNS-Less Firebird Crystal Report? How?

A: 

It seems that it is necessary the DSN parameter, so:

rpt.DataSourceConnections[0].SetConnection("DSN=MyDSN;Driver=Firebird/InterBase(r) driver;DBName=C:\tmp\db.gdb;UID=SYSDBA;PWD=masterkey", "", "", "");

this instruction worked! But now I need to communication with a server (not localhost) and I use

rpt.DataSourceConnections[0].SetConnection("DSN=MyDSN;Driver=Firebird/InterBase(r) driver;DBName=Server:C:\tmp\db.gdb;UID=SYSDBA;PWD=masterkey", "", "", "");

and it didn't work! I will follow trying...

jjroman