p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Crystal Reports (http://p2p.wrox.com/forumdisplay.php?f=113)
-   -   Addling table links from VB (http://p2p.wrox.com/showthread.php?t=13204)

MoyesBlue May 20th, 2004 04:36 AM

Addling table links from VB

I have a report that I access through RDC

At runtime, I add a temp SQL server view to the report

That works fine

I then try and add a link from the newly added table to an existing table on
report and get the following error

WArning - Fields in the report from the file """ cannot be linked

If I add the view in manaually in Crystal then the view and the table link

This is my VB code

Set mobjApplication = New CRAXDDRT.Application
mobjApplication.LogOnServer "PDSODBC.DLL", "VtsMain", "VtsMain", "sa",
subGroupChooseReport ' open selected report

X.ActiveConnection = "Provider=MSDASQL.1;Persist SecurityInfo=False;User
ID=sa;pwd=xxxx;Data Source=VTSMain"
X.Open ("Select * from tester")
'add view to report
mobjreport.Database.AddADOCommand X.ActiveConnection, X.ActiveCommand

Set tab1 = mobjreport.Database.Tables(1) ' table i want to link to
Set tab2 = mobjreport.Database.Tables(11) ' 11 being the new view added to
Debug.Print mobjreport.Database.Links.Count

'attempt to add link
mobjreport.Database.Links.Add tab2, tab1, 30, 1, crJTEqual,
crLTLookupProduct, False, 1

All times are GMT -4. The time now is 10:10 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.