Hola amigos tengo este code y en mi PC y en algunas donde instalo el programa anda bien pero en otras me tira el error y no puede entender por que por que incluso le instalo el Crystal report a la pc donde no anda y sigue haciendo lo mismo:
Dim strSelFormula As String, strTitle As String
GenerateDSN
With MAIN.CR
.Reset: MAIN.InitCrys
If obRecToPrint(0).Value = True Then
.ReportFileName = App.Path & "\Reports\rptCustomer.rpt"
Else
.ReportFileName = App.Path & "\Reports\rptCustomerWB.rpt"
End If
.Connect = "DSN=" & App.Path & "\rptCN.dsn;PWD=*******"
If obPrintOp(1).Value = True Then
strSelFormula = "{tbl_AR_Customer.VanFK}=" & dcVan.BoundText
strTitle = "LISTADO DE CLIENTES (" & dcVan.Text & ")"
Else
strTitle = "LISTADO DE CLIENTES"
End If
If chkNew.Value = 1 Then
If strSelFormula = "" Then
strSelFormula = "{tbl_AR_Customer.Status}='Nuevo'"
Else
strSelFormula = strSelFormula & " AND {tbl_AR_Customer.Status}='Nuevo'"
End If
strTitle = "NUEVOS " & strTitle
End If
If obRecToPrint(1).Value = True Then
strSelFormula = Replace(strSelFormula, "tbl_AR_Customer", "qry_AR_CustomerWB")
End If
.SelectionFormula = strSelFormula
.WindowTitle = strTitle
.ParameterFields(0) = "prBussAddr;" & CurrBiz.BUSINESS_ADDRESS & ";True"
.ParameterFields(1) = "prmBussContact;" & CurrBiz.BUSINESS_CONTACT_INFO & ";True"
.ParameterFields(2) = "prmTitle;" & strTitle & ";True"
.PageZoom 100
.Action = 1
End With
RemoveDSN
strSelFormula = vbNullString: strTitle = vbNullString
cuando llega a la linea .Action = 1
me da un El error “20599 Cannot open SQL Server”