sandrobrz
22-Jul-2010, 08:49 AM
New tools, old problems.
VDF 15.1 + Sql server + driver da mertech
We all know that DataFlex to access tables that are not native to your database uses the files int.
Well, within these files INT I omit the server information and password, they are reported to the application at runtime.
And thus do not have to be changing the files INT, when I need to access a server or another.
When developing reports in Crystal, wearing your own connector to the database sql server, and run-time changed the password and sql server.
As in routine below.
Procedure OnInitializeReport Handle hoReport
Handle[] hoTables
Handle hoDatabaseTable hoDatabase
Integer iTableItem iTableCount
Boolean bOK
Forward Send OnInitializeReport hoReport
Get DatabaseObject of hoReport to hoDatabase
If (hoDatabase) Begin
Get TableObjects of hoDatabase to hoTables
Move (SizeOfArray(hoTables)) to iTableCount
For iTableItem from 0 to (iTableCount -1)
Move hoTables[iTableItem] to hoDatabaseTable
If (hoDatabaseTable) Begin
// set the same password for all the tables in the ADO datasource
Get SetPassword hoDatabaseTable senha_sql to bOK
Get SetServer hoDatabaseTable servidor_sql to bOK
End
Loop
End
end_procedure
The big question, how in VRW, since I'm using as if it were based DataFlex (since it opens through int), thus gain the relationships of tables that already have the project in VDF.
The only way I managed to beat done is put the username, password and the file server INT.
What I want to avoid because it creates a terrible security hole.
VDF 15.1 + Sql server + driver da mertech
We all know that DataFlex to access tables that are not native to your database uses the files int.
Well, within these files INT I omit the server information and password, they are reported to the application at runtime.
And thus do not have to be changing the files INT, when I need to access a server or another.
When developing reports in Crystal, wearing your own connector to the database sql server, and run-time changed the password and sql server.
As in routine below.
Procedure OnInitializeReport Handle hoReport
Handle[] hoTables
Handle hoDatabaseTable hoDatabase
Integer iTableItem iTableCount
Boolean bOK
Forward Send OnInitializeReport hoReport
Get DatabaseObject of hoReport to hoDatabase
If (hoDatabase) Begin
Get TableObjects of hoDatabase to hoTables
Move (SizeOfArray(hoTables)) to iTableCount
For iTableItem from 0 to (iTableCount -1)
Move hoTables[iTableItem] to hoDatabaseTable
If (hoDatabaseTable) Begin
// set the same password for all the tables in the ADO datasource
Get SetPassword hoDatabaseTable senha_sql to bOK
Get SetServer hoDatabaseTable servidor_sql to bOK
End
Loop
End
end_procedure
The big question, how in VRW, since I'm using as if it were based DataFlex (since it opens through int), thus gain the relationships of tables that already have the project in VDF.
The only way I managed to beat done is put the username, password and the file server INT.
What I want to avoid because it creates a terrible security hole.